Multi-tomcat auto start under Ubuntu

Source: Internet
Author: User

1: First install the Self-starter management tool

Apt-get Install sysv-rc-conf

2: Append Tomcat startup script

For example, a service needs to start three Tomcat, then create a tomcat-a script file and place it under/etc/init.d/

Note The file permissions are set to 755. The script reads as follows:

export JAVA_HOME=/usr/lib/jvm/default-java
case $1 in
start)
sh /usr/local/tomcat/A/1/bin/startup.sh
sh /usr/local/tomcat/A/2/bin/startup.sh
sh /usr/local/tomcat/A/3/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/A/1/bin/shutdown.sh
sh /usr/local/tomcat/A/2/bin/shutdown.sh
sh /usr/local/tomcat/A/3/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/A/1/bin/shutdown.sh
sh /usr/local/tomcat/A/2/bin/shutdown.sh
sh /usr/local/tomcat/A/3/bin/shutdown.sh
sh /usr/local/tomcat/A/1/bin/startup.sh
sh /usr/local/tomcat/A/2/bin/startup.sh
sh /usr/local/tomcat/A/3/bin/startup.sh
;;
esac
exit 0

3: Execute self-boot command

Sysv-rc-conf tomcat-a on

4: Reboot

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.