Register Tomcat as a Linux service. this document takes Tomcat 6 as an example. Step 1: Create a file named Tomcat 6 (without a suffix). replace the Txt code in the path where Tomcat is located. /etc/init. d/functions [-f/usr/local/apache-tom... register Tomcat as a Linux service. this document takes Tomcat 6 as an example. Step 1: Create a file named Tomcat 6 (without a suffix). replace the Txt code in the Tomcat path. /etc/init. d/functions [-f/usr/local/apache-tomcat-6.0.23/bin/startup. sh] | exit 0 [-f/usr/local/apache-tomcat-6.0.23/bin/shutdown. sh] | exit 0 RETVAL = 0 umask 077 start () {Echo-n $ "Starting Tomcat 6 Java server:" daemon su-c/usr/local/apache-tomcat-6.0.23/bin/startup. sh-tomcat echo return $ RETVAL} stop () {echo-n $ "Shutting down Tomcat Java server: & quot; daemon su-c/usr/local/apache-tomcat-6.0.23/bin/shutdown. sh-tomcat echo return $ RETVAL} restart () {stop start} case "$1" in start) start; stop) stop; restart | reload) restart ;;*) echo $ "Usage: $0 {Start | stop | restart} "exit 1 esac exit $? Step 2: upload the file in step 1 to:/etc/rc. d/init. d directory, and run the command: Shell code chkconfig -- add tomcat6 Step 3: Now you can start and stop tomcat with the following command: Shell Code service tomcat5 start/stop/restart
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