1. Enter the /etc/init.d directory: cd /etc/init.d 2. Create a tomcat service configuration file: vi tomcat 3. Copy the following code into the created tomcat configuration file: #idea - tomcat config start - 2016-05-01 #!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 2345 20 80 JAVA_HOME=/usr/local/java/jdk export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH #idea - tomcat config start - 2016-05-01 #!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 2345 20 80 JAVA_HOME=/usr/local/java/jdk export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CATALINA_HOME=/usr/local/tomcat case $1 in start) sh $CATALINA_HOME/bin/startup.sh ;; stop) sh $CATALINA_HOME/bin/shutdown.sh ;; restart) sh $CATALINA_HOME/bin/shutdown.sh sh $CATALINA_HOME/bin/startup.sh ;; esac exit 0 #chmod 755 tomcat #chkconfig --add tomcat #chkconfig --level 2345 tomcat on 4. Press exc and enter: wq! Save and exit 5. Assign executable permissions to tomcat: chmod +x tomcat 6. Add tomcat as a system service: chkconfig --add tomcat 7. Enter the command to check whether the addition is successful: chkconfig --list 2, 3, 4, 5 are all open to start following the system 8. Start tomcat command: service tomcat start 9. You can enter ip:8080 in the browser to view the tomcat page This is the end of this article about setting up tomcat to start automatically on boot in Linux system. For more relevant content about Linux tomcat starting automatically on boot, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of the use of CSS scope (style splitting)
>>: Will the most successful companies in the future be technology companies or design companies?
Table of contents After creating a container loca...
It is very common to see images and text displaye...
Table of contents 1 Difference 1.1 Space Occupanc...
MySQL5.6 How to create SSL files Official documen...
This article is an integrated article on how to c...
LocalStorage stores Boolean values Today, when I ...
Pure CSS3 makes a butterfly flapping its wings, s...
Introduction yum (Yellow dog Updater, Modified) i...
Using DOSBox, you can simulate DOS under Windows ...
Table of contents 1. Direct assignment 2. Shallow...
This article shares the specific code of JavaScri...
Basic Concepts Absolute positioning: An element b...
This article example shares the specific code of ...
The code looks like this: <!DOCTYPE html> &...
I would like to share the installation and config...