« Extra public classes in deploying Apache httpd and Tomcat | Main | Online hotel reservations - Melksham, Wiltshire (near Bath) »
February 24, 2008
Automatic startup and shutdown of Tomcat
Setting up Tomcat to shutdown and startup automatically when the Linux / Unix server restarts. The following is for Fedora Linux, with Tomcat installed at /usr/local/tomcat (probably via a symlink as taught on our deployment course). Server configuration - assuming a default run state of 3.
1. Copy catalina.sh to /etc/init.d/tomcatrun
2. Add the following after the #! line but before any executable code
CATALINA_HOME=/usr/local/tomcat
export CATALINA_HOME
PATH=/usr/local/java/bin:$PATH
export PATH
JAVA_HOME=/usr/local/java
export JAVA_HOME
3. Add the following symlinks in the /etc/rc3.d directory
lrwxrwxrwx 1 root root 19 Feb 23 10:37 K04tomcat -> ../init.d/tomcatrun
lrwxrwxrwx 1 root root 19 Feb 23 10:37 S98tomcat -> ../init.d/tomcatrun
Let me stress - this is an example - you may have differences depending on the OS flavour, default run state, install directory for Tomcat, and other daemons that you are starting.
Posted by gje at February 24, 2008 05:30 AM