A Liferay init script This is for the pre systemd init systems in Red Hat/CentOS/Fedora.
Copied from this article with minor changes.
#!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 2345 20 80 JAVA_HOME=/usr/lib/jvm/java export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CATALINA_HOME=/data/app/liferay/tomcat case $1 in start) sh $CATALINA_HOME/bin/startup.sh ;; stop) sh $CATALINA_HOME/bin/shutdown.sh ;; restart) sh $CATALINA_HOME/bin/shutdown.sh sh $CATALINA_HOME/bin/startup.sh ;; esac exit 0
On my test systems a liferay user and group own /data/app/liferay, which is also their $HOME. I am currently testing with OpenJDK 1.7.0_55, as this is the standard JDK in use at my company for most open source software. Note that I’m using the latest Liferay zip bundle that includes Tomcat 7.0.42, and that I’ve created a “tomcat” symlink to the versioned app server directory to avoid having to change things when the version changes (all I’ll need to do is re-create the symlink).