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?
Preface I believe most people have used MySQL and...
1. Problem Forgot password for mysql5.7 under lin...
Let's take a look at the detailed method of b...
Table of contents What is JSON Why this technolog...
MySQL escape Escape means the original semantics ...
The project needs to use MySQL. Since I had alway...
Table of contents 1. Introduction 2. JDBC impleme...
Introduction to Linux alarm function Above code: ...
Table of contents Preface Step 1: Setup and front...
How to view version information under Linux, incl...
As shown below: XML/HTML CodeCopy content to clip...
DOCTYPE Doctype is used to tell the browser which...
Today, when I was using Nginx, a 500 error occurr...
Preface Today, when I was designing a feedback fo...
Let’s take a look at a chestnut first EXPLAIN sel...