Linux tomcat boot from boot

Source: Internet
Author: User

Method One:


Linux tomcat boot from boot
Modify the tomcat/bin/startup.sh to:
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
/usr/local/tomcat/bin/catalina.sh start

Add in/etc/rc.d/rc.local:
/usr/local/tomcat/bin/startup.sh

Method Two:

1. Save the following code as a tomcat file and make it an executable file chmod 755 tomcat.
#!/bin/bash
#
# kenny [email protected]
#/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:unable to locate functions lib. Cannot continue. "
Exit-1
Fi

Retval=$?
Catalina_home= "/usr/local/tomcat"

Case "$" 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: $ {start|stop}"
Exit 1
;;
Esac

Exit $RETVAL

2. Copy the Tomcat file to/etc/init.d/and run: Chkconfig--add Tomcat

3. Add the following statement to the tomcat/bin/catalina.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

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.