Java Secure Sockets Extension (JSSE) JARsif [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then JSSE_HOME="${JAVA_HOME}/jre/"ficatalina_sh() { # Escape any double quotes in the value of JAVA_OPTS JAVA_OPTS="$(echo $JAVA_OPTS | sed 's/\"/\\\"/g')" # Define the command to run Tomcat's catalina.sh as a daemon # set -a tells sh to export assigned variables to spawned shells. TOMCAT_SH="set -a; JAVA_HOME=\"$JAVA_HOME\"; \ CATALINA_HOME=\"$CATALINA_HOME\"; \ CATALINA_BASE=\"$CATALINA_BASE\"; \ JAVA_OPTS=\"$JAVA_OPTS\"; \ CATALINA_PID=\"$LIFERAY_PID\"; \ CATALINA_TMPDIR=\"$CATALINA_TMPDIR\"; \ LANG=\"$LANG\"; JSSE_HOME=\"$JSSE_HOME\"; \ cd \"$CATALINA_BASE\"; \ \"$LIFERAY_SH\" $@" # Run the catalina.sh script as a daemon set +e touch "$LIFERAY_PID" "$CATALINA_BASE"/logs/catalina.out chown $LIFERAY_USER "$LIFERAY_PID" "$CATALINA_BASE"/logs/catalina.out start-stop-daemon --start -b -u "$LIFERAY_USER" -g "$LIFERAY_GROUP" \ -c "$LIFERAY_USER" -d "$CATALINA_TMPDIR" -p "$LIFERAY_PID" \ -x /bin/bash -- -c "$TOMCAT_SH" status="$?" set +a -e return $status}case "$1" in start) if [ -z "$JAVA_HOME" ]; then log_failure_msg "no JDK found - please set JAVA_HOME" exit 1 fi if [ ! -d "$CATALINA_BASE/conf" ]; then log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE" exit 1 fi log_daemon_msg "Starting $DESC" "$NAME" if start-stop-daemon --test --start --pidfile "$LIFERAY_PID" \ --user $LIFERAY_USER --exec "$JAVA_HOME/bin/java" \ >/dev/null; then # Remove / recreate JVM_TMP directory rm -rf "$JVM_TMP" mkdir -p "$JVM_TMP" || { log_failure_msg "could not create JVM temporary directory" exit 1 } chown $LIFERAY_USER "$JVM_TMP" catalina_sh start sleep 5 if start-stop-daemon --test --start --pidfile "$LIFERAY_PID" \ --user $LIFERAY_USER --exec "$JAVA_HOME/bin/java" \ >/dev/null; then if [ -f "$LIFERAY_PID" ]; then rm -f "$LIFERAY_PID" fi log_end_msg 1 else log_end_msg 0 fi else log_progress_msg "(already running)" log_end_msg 0 fi ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" set +e if [ -f "$LIFERAY_PID" ]; then start-stop-daemon --stop --pidfile "$LIFERAY_PID" \ --user "$LIFERAY_USER" \ --retry=TERM/20/KILL/5 >/dev/null if [ $? -eq 1 ]; then log_progress_msg "$DESC is not running but pid file exists, cleaning up" elif [ $? -eq 3 ]; then PID="`cat $LIFERAY_PID`" log_failure_msg "Failed to stop $NAME (pid $PID)" exit 1 fi rm -f "$LIFERAY_PID" rm -rf "$JVM_TMP" else log_progress_msg "(not running)" fi log_end_msg 0 set -e ;; status) set +e start-stop-daemon --test --start --pidfile "$LIFERAY_PID" \ --user $LIFERAY_USER --exec "$JAVA_HOME/bin/java" \ >/dev/null 2>&1 if [ "$?" = "0" ]; then if [ -f "$LIFERAY_PID" ]; then log_success_msg "$DESC is not running, but pid file exists." exit 1 else log_success_msg "$DESC is not running." exit 3 fi else log_success_msg "$DESC is running with pid `cat $LIFERAY_PID`" fi set -e ;; restart|force-reload) if [ -f "$LIFERAY_PID" ]; then $0 stop sleep 1 fi $0 start ;; try-restart) if start-stop-daemon --test --start --pidfile "$LIFERAY_PID" \ --user $LIFERAY_USER --exec "$JAVA_HOME/bin/java" \ >/dev/null; then $0 start fi ;; *) log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" exit 1 ;;esacexit 0Ajustes finaisComo estamos no Brasil, vamos configurar corretamente o Liferay CE.# nano /usr/share/liferay/liferay-portal/tomcat-7.0.27/bin/setenv.shRemova a definicao de user.timezone do arquivo aberto no comando acima.# nano /usr/share/liferay/liferay-portal/tomcat/webapps/ROOT/WEB-INF/classes/system-ext.propertiesAdicione as seguintes linhas no arquivo aberto pelo ultimo comandouser.country=BRuser.language=ptuser.timezone=America/Sao_Paulo# Caso utilize proxy, descomente e configure as linhas abaixo#http.proxyHost=127.0.0.1#http.proxyPort=3128ConcluindoConfigure o script na inicializacao do sistema.# chmod +x /etc/init.d/liferay# update-rc.d liferay defaults# tail -f /usr/share/liferay/liferay-portal/tomcat/log/catalina.outO Liferay deve iniciar automaticamente, mas, as vezes, pode demorar um pouco.ConsideracoesEsta postagem tem como objetivo apenas abordar a instalacao do Liferay CE no Debian, sem entrar nas configuracoes do Liferay em si. Lembre que