Tomcat 7 is automatically started on Ubuntu

Source: Internet
Author: User
To enable Tomcat to start automatically on Ubuntu, when the computer restarts, you must add a script to enable or disable Tomcat tomaketomcatautomaticallystartwhenwebootupthecomputer, youcanaddascripttomakeitauto-startandshutdown.sudogedit/etc/I

To enable Tomcat to start automatically on Ubuntu, you must add a script to enable or disable tomcat automatically when the computer restarts.

To make tomcat automatically start when we boot up the computer, you can add a script to make it auto-start and shutdown.

Sudo gedit/etc/init. d/tomcat7

Now paste in the following:
Add the following text

# Tomcat auto-start # description: Auto-starts tomcat # processname: tomcat # pidfile:/var/run/tomcat. pidcase $1 instart) sh/usr/share/tomcat7/bin/startup. sh; stop) sh/usr/share/tomcat7/bin/shutdown. sh; restart) sh/usr/share/tomcat7/bin/shutdown. shsh/usr/share/tomcat7/bin/startup. sh; esac exit 0
Modify permissions for execution
You'll need to make the script executable by running the chmod command:

Sudo chmod 755/etc/init. d/tomcat7
The last step is to create a link file in the startup directory and execute the following two statements:
The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we shocould be on our way.

Sudo ln-s/etc/init. d/tomcat7/etc/rc1.d/K99tomcatsudo ln-s/etc/init. d/tomcat7/etc/rc2.d/S99tomcat

Tomcat shoshould now be fully installed and operational. Enjoy!
At this time, TOMCAT should be able to run sudo/etc/init. d/tomcat7 restart

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.