Inux set Tomcat to start automatically under CentOS, after power-on will automatically execute commands in/etc/rc.local, normally launched Tomcat command for tomcat_home/bin/startup.sh or tomcat_home/bin/ catalina.sh start, when you add any of them directly to the/etc/rc.local, reboot the machine and find that Tomcat does not start. The reason is that the Java environment is not set up at boot time, so write a script, first set up the Java environment, and then start, the script is as follows:
Export Java_home=/usr/local/jdk1.6.0_30export path= $JAVA _home/bin/: $PATHexport classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $CLASSPATHexport catalina_home=/usr/local/tomcat-6.0.35//usr/local/tomcat-6.0.35/bin/ catalina.sh start
Assume that a file that is saved as a auto-startup.sh is stored under/usr/local/tomcat-6.0.35/bin and then added/usr/local/tomcat-6.0.35/bin/in/etc/rc.local Auto-startup.sh can be. Note: You need to set auto-startup.sh to have execute permission.
Linux setup Tomcat self-booting method