Nesta postagem vamos ver como instalar o Liferay CE 6.1.1 (pacote com Tomcat 7) no Debian Squeeze, com criacao de usuario especifico e configuracao de daemon atraves de script init.d.RequisitosO Liferay e um aplicativo baseado em Java, entao, precisamos ter instalado um JDK, eu recomendo o pacote sun-java6-jdk da distribuicao non-free do Squeeze, mas se preferir outro fique a vontade.Precisamos de um descompactador zip, recomendo o unzip disponivel na distribuicao main do Squeeze.Todos os comandos abaixo serao executados em modo super usuario, entao, caso nao tenha realizado login como root, realize a autorizacao com o comando suCriando usuario e grupoVamos criar usuario e grupo de sistema.# addgroup --system liferay# adduser --system --home /usr/share/liferay --no-create-home --ingroup liferay --disabled-password --shell /bin/false liferayInstalandoBaixando o pacote# cd ~# wget http://ufpr.dl.sourceforge.net/project/lportal/Liferay%20Portal/6.1.1%20GA2/liferay-portal-tomcat-6.1.1-ce-ga2-20120731132656558.zipCriando estrutura de pastas e descompactando# mkdir /usr/share/liferay# cd /usr/share/liferay/# unzip /root/liferay-portal-tomcat-6.1.1-ce-ga2-20120731132656558.zipCriando links simbolicos uteis# ln -s liferay-portal-6.1.1-ce-ga2/ liferay-portal# cd liferay-portal# ln -s tomcat-7.0.27/ tomcatDefinindo permissoes de pastas# chown -R liferay:liferay /usr/share/liferay/*# chmod -R ug=rwx /usr/share/liferay/*Preparando script daemon# nano /etc/init.d/liferayO script abaixo que forneco como exemplo e uma modificacao do script para o Tomcat 6 do proprio Debian Squeeze. Existem outras opcoes disponiveis na internet, se preferir pode utilizar alguma outra mas talvez tenha de mudar um pouco as configuracoes do usuario criado.#!/bin/sh## /etc/init.d/liferay -- startup script for the Liferay CE## Written by Miquel van Smoorenburg .# Modified for Debian GNU/Linux by Ian Murdock .# Modified for Tomcat by Stefan Gybas .# Modified for Tomcat6 by Thierry Carrez .# Additional improvements by Jason Brittain .# Modified for Liferay by cweiler#### BEGIN INIT INFO# Provides: liferay# Required-Start: $local_fs $remote_fs $network# Required-Stop: $local_fs $remote_fs $network# Should-Start: $named cntlm apache2 mysql# Should-Stop: $named# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start Liferay.# Description: Start the Liferay CE.### END INIT INFOset -ePATH=/bin:/usr/bin:/sbin:/usr/sbinNAME=liferayDESC="Liferay CE"JVM_TMP=/tmp/liferay-$NAME-tmpif [ `id -u` -ne 0 ]; then echo "You need root privileges to run this script" exit 1fi# Make sure liferay is started with system localeif [ -r /etc/default/locale ]; then . /etc/default/locale export LANGfi. /lib/lsb/init-functionsif [ -r /etc/default/rcS ]; then . /etc/default/rcSfi# Run Liferay as this user ID and group IDLIFERAY_USER=liferayLIFERAY_GROUP=liferay# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm"# Look for the right JVM to usefor jdir in $JDK_DIRS; do if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then JAVA_HOME="$jdir" fidoneexport JAVA_HOME# Directory where the Tomcat 6 binary distribution residesCATALINA_HOME=/usr/share/liferay/liferay-portal/tomcat# Directory for per-instance configuration files and webappsCATALINA_BASE=$CATALINA_HOME# Default Java options# Set java.awt.headless=true if JAVA_OPTS is not set so the# Xalan XSL transformer can work without X11 display on JDK 1.4+# It also looks like the default heap size of 64M is not enough for most cases# so the maximum heap size is set to 128Mif [ -z "$JAVA_OPTS" ]; then JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"fi# End of variables that can be overwritten in $DEFAULTif [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then log_failure_msg "$NAME is not installed" exit 1fiif [ -z "$CATALINA_TMPDIR" ]; then CATALINA_TMPDIR="$JVM_TMP"fi# Set the JSP compiler if set in the tomcat6.default fileif [ -n "$JSP_COMPILER" ]; then JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=\"$JSP_COMPILER\""fi# Define other required variablesLIFERAY_PID="/var/run/$NAME.pid"LIFERAY_SH="$CATALINA_HOME/bin/catalina.sh"# Look for