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 What is a container data volume...
Table of contents Preface 1. Current gcc version ...
Problem Description Recently, there was a MySQL5....
Many times, we ignore the setting of the web page ...
Table of contents Undo Log Undo Log Generation an...
1. Introduction Docker has an orchestration tool ...
To transfer files between the host and the contai...
Whitelist rule syntax: BasicRule wl:ID [negative]...
Table of contents 1. Introduction 2. Interface 3....
Page layout has always been my concern since I st...
This article example shares the specific code for...
This article mainly introduces CSS circular hollo...
This article mainly introduces how to build a MyS...
This article mainly introduces the ::master pseud...
Two methods to implement Mysql remote connection ...