In linux, after tomcat is started and configured in linux, if you want tomcat to start automatically after it is configured in linux, another configuration is required. the following two methods are introduced! Tomcat startup Method 1: modify tomcat/bin/startup automatically when Tomcat is started in linux. sh: exportJ... in linux, after tomcat is started and configured in linux, if you want tomcat to start automatically after it is configured in linux, another configuration is required. the following two methods are introduced! Tomcat startup Method 1: modify tomcat/bin/startup automatically when Tomcat is started in linux. sh: export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 08 export CLASSPATH = $ CLASSPATH: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar :. export PATH = $ PATH: $ JAVA_HOME/bin export CATALINA_HOME =/usr/local/tomcat/bin/catalina. sh start in/etc/rc. d/rc. add:/usr/local/tomcat/bin/startup to local. sh tomcat boot Method 2: 1. Save the following code as a tomcat file and make it an executable file chmod 755 tomcat .#! /Bin/bash # kenny.zhou@tom.com #/etc/rc. d/init. d/tomcat # init script for tomcat precesses # processname: tomcat # description: tomcat is a j2se server # chkconfig: 2345 86 16 # description: Start up the Tomcat servlet engine. if [-f/etc/init. d/functions]; then. /etc/init. d/functions elif [-f/etc/rc. d/init. d/functions]; then. /etc/rc. d/init. d/functions else echo-e "\ atomcat: una Ble to locate functions lib. Cannot continue. "exit-1 fi RETVAL =$? CATALINA_HOME = "/usr/local/tomcat" case "$1" in start) if [-f $ CATALINA_HOME/bin/startup. sh]; then echo $ "Starting Tomcat" $ CATALINA_HOME/bin/startup. sh fi; stop) if [-f $ CATALINA_HOME/bin/shutdown. sh]; then echo $ "Stopping Tomcat" $ CATALINA_HOME/bin/shutdown. sh fi; *) echo $ "Usage: $0 {start | stop}" exit 1 ;; esac exit $ RETVAL # The above is the startup script code for tomcat startup 2. copy the tomcat file to/etc/init. d/and run: chkconfig -- Add tomcat // indicates adding the tomcat service. 3. in tomcat/bin/catalina. add the following statement to The sh file: export JAVA_HOME =/YOURPATH/tomcat/jdk export CATALINA_HOME =/YOURPATH/tomcat export CATALINA_BASE =/YOURPATH/tomcat export CATALINA_TMPDIR =/YOURPATH/tomcat/temp start tomcat: service tomcat start stop tomcat: service tomcat stop so far, all the configuration for starting tomcat at startup is complete. tomcat will be automatically started next time you restart linux!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service