How the Linux service automatically starts tomcat manually

Source: Internet
Author: User
Tags apache tomcat

There are several ways to start a Linux service, and sometimes it is not possible to use the Chkconfig command to run level settings and NTSYSV graphics run level settings, which can effectively resolve the problem.

Production environment:

OS: CentOS Release 6.7 (Final)

Web server: Apache tomcat/7.0.57

task: Linux starts automatically when you start Tomcat service.

The Linux auto-start service is configured as follows:

[Email protected] ~]#

[[Email protected]~]# cd/etc/rc.d

[Email protected]]# VI rc.local

#!/bin/sh

#

# This script would beexecuted *after* all the other init scripts.

# can put your owninitialization stuff in here if you don ' t

# want to does the full Sys vstyle init stuff.

Touch/var/lock/subsys/local

/usr/local/tomcat/bin/startup.sh #随系统自动启动tomcat Service

/usr/local/apache2/bin/apachectlstart

Start the Tomcat service manually as follows:

[Email protected] ~]#

[Email protected] ~]# Cd/usr/local/tomcat

[[email protected] tomcat] #cd bin

[Email protected] bin]#

[Email protected] bin]#./shutdown.sh #关闭tomcat服务

Using catalina_base:/usr/local/tomcat

Using Catalina_home:/usr/local/tomcat

Using Catalina_tmpdir:/usr/local/tomcat/temp

Using Jre_home:/usr/java/jdk1.7.0_71

Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

[email protected] bin]#./startup.sh #启动tomcat服务

Using catalina_base:/usr/local/tomcat

Using Catalina_home:/usr/local/tomcat

Using Catalina_tmpdir:/usr/local/tomcat/temp

Using Jre_home:/usr/java/jdk1.7.0_71

Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

Tomcat started.


This article is from the "Linux~dba~mba~eie" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1733086

How the Linux service automatically starts tomcat manually

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.