1. Copy the catalina.sh in the Bin folder under the Tomcat installation directory to/ETC/INIT.D and modify the name Tomcat
Cp/path/to/tomcat/bin/catalina.sh/etc/init.d
Cd/etc/init.d
MV Catalina.sh Tomcat
Execute the above three commands separately if you are prompted to add sudo at the beginning of the error
2. Open the Tomcat file
sudo gedit Tomcat
3. Modify the Tomcat file additions
catalina_home=opt/apache-tomcat-6.0.32
Java_home=/usr/lib/jvm/java-6-sun
4. Start the Tomcat service using the service command
Cd/etc/init.d
Service Tomcat start #如果出错, please add sudo in front
5. Stop the Tomcat service
Service Tomcat stop# If there is an error, please add sudo to the front
The first three steps are to create a script to start Tomcat, which can accept parameters such as start stop restart. This script can also be written in other scripting languages.
Set Tomcat under Ubuntu to become a service (boot boot)