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