Linux Server booting up tomcat

Source: Internet
Author: User

The program self-launch script is essentially a shell script. As an example of a simple Tomcat self-starter script, Tomcat uses the startup.sh in the installation directory to start, shutdown.sh stop, and we can write them into a startup script.

1. Create a self-starter script:

Vim/etc/init.d/tomcat

Enter the following content:

1#!/bin/Bash2 #3# Tomcat Startup script forThe Tomcat server4 #5# chkconfig:345 80 206 # Description:start the tomcat Deamon7 #8 # Source Function library9. /etc/rc.d/init.d/functionsTen  Oneprog=Tomcat Ajava_home=/home/jdk1.7.0 - Export Java_home -catalana_home=/home/Tomcat the Export Catalina_home -  -  Case"$"inch - start) +echo "Starting Tomcat ..." -$CATALANA _home/bin/startup.sh + ;; A  at stop) -echo "Stopping Tomcat ..." -$CATALANA _home/bin/shutdown.sh - ;; -  - restart) inecho "Stopping Tomcat ..." -$CATALANA _home/bin/shutdown.sh toSleep 2 + Echo -echo "Starting Tomcat ..." the$CATALANA _home/bin/startup.sh * ;; $ Panax Notoginseng*) -echo "Usage: $prog {Start|stop|restart}" the ;; + Esac AExit 0

Enter/etc/init.d/to give executable permissions to the Tomcat script that you just created chmod a+x Tomcat

2. Add the startup script to boot Chkconfig tomcat on and reboot the server tomcat automatically started.

This is the start of the Tomcat boot implementation!

Linux Server booting up tomcat

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.