2341 发表于 2016-1-11 10:23:34

linux服务自动手动启动tomcat的方式

Linux服务自启动的方式有多种,有时候无法通过chkconfig命令运行级别设置和ntsysv图形运行级别设置时,此下方法可以有效解决问题。
生产环境:
OS: CentOS release 6.7 (Final)
Web服务器:Apache Tomcat/7.0.57任务:Linux启动时需要自动启动Tomcat服务。Linux自动启动服务配置方式如下:## cd/etc/rc.d
[root@sky9896rc.d]# virc.local
#!/bin/sh
#
# This script will beexecuted *after* all the other init scripts.
# You can put your owninitialization stuff in here if you don't
# want to do the full Sys Vstyle init stuff.
touch /var/lock/subsys/local
/usr/local/tomcat/bin/startup.sh#随系统自动启动tomcat服务
/usr/local/apache2/bin/apachectlstart
手动启动Tomcat服务方式如下:## cd/usr/local/tomcat#cdbin##./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
#./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.


页: [1]
查看完整版本: linux服务自动手动启动tomcat的方式