Configure Tomcat to boot from Linux

Source: Internet
Author: User

configure Tomcat to boot from Linux1, write a tomcat script, the content is as follows, set its permission to 755, placed in the/etc/init.d/directory
#!/bin/bash
#
#/etc/init.d/tomcat
# init script for Tomcat precesses
#
# Processname:tomcat
# 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/tomcat85"

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. Add the following three lines in catalina.sh (under Export qibm_multi_threaded=y):

Export Java_home=/usr/local/jdk18
Export Catalina_base=/usr/local/tomcat85
Export Catalina_home=/usr/local/tomcat85
Export Catalina_tmpdir=/usr/local/tomcat85/temp

3. Add the startup script to the management of Chkconfig

Chkconfig--add Tomcat

4, you can use the services Tomcat Start|stop to manage Tomcat

Configure Tomcat to boot from Linux

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.