Linux setup Tomcat self-booting method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.