The method of setting up boot by Linux-tomcat
The main content of this article is to explain "Linux-tomcat setup boot method", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn the "Linux-tomcat setup boot boot method"!
Step 1: start the tomcat service through service
If you want to start a custom service through service, just set up a startup script under / etc/init.d/
Startup mode:
Service tomcat start/stop
Create the tomcat file and then empower it
Chmod + x / etc/init.d/tomcat
Edit the tomcat file:
#! / bin/sh-e # chkconfig: 2345 20 8 million description: tomcat### BEGIN TOMCAT SERVICE### END INIT INFOexport JAVA_HOME=/usr/local/java/jdk1.8.0_201export JRE_HOME=$JAVA_HOME/jreexport PATH=$PATH:$JAVA_HOME/binexport CLASSPATH=.export CATALINA_HOME=/opt/apache-tomcat-8.5.39/case "$1" instart) ${CATALINA_HOME} / bin/startup.sh echo 'tomcat start success' exit 0 Stop) ${CATALINA_HOME} / bin/shutdown.sh echo 'tomcat stop success' exit 0;; debug) ${CATALINA_HOME} / bin/shutdown.sh ${CATALINA_HOME} / bin/catalina.sh run exit 0;; force-reload | restart) ${CATALINA_HOME} / bin/startup.sh ${CATALINA_HOME} / bin/shutdown.sh exit 0 *) echo "Usage: / etc/init.d/tomcat {start | stop | restart | force-reload | debug}" exit 1;; esacexit 0
Note: you need to add # chkconfig: 2345 20 80 or you can't join the boot boot.
So we can start the service tomcat start startup service.
Step 2: add the service to boot
Add tomcat service
Chkconfig-add tomcat
View Servic
Chkconfig-list
Set up boot boot
Chkconfig tomcat on
At this point, I believe that you have a deeper understanding of the "Linux-tomcat setup boot method", you might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!