CentOS 配置Tomcat服務腳本

#!/bin/bash  
# description: Tomcat7 Start Stop Restart  
# processname: tomcat7  
# chkconfig: 234 20 80  
JAVA_HOME=/usr/local/jdk1.7.0_17  
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH  
export PATH  
#CATALINA_HOME=/u01/tomcat  
  
case $1 in  
start)  
sh $CATALINA_HOME/bin/startup.sh  
;;   
stop)     
sh $CATALINA_HOME/bin/shutdown.sh  
;;   
restart)  
sh $CATALINA_HOME/bin/shutdown.sh  
sh $CATALINA_HOME/bin/startup.sh  
;;   
esac      
exit 0

可使用以下命令啓動和中止Tomcattomcat

/etc/init.d/tomcat restartbash

相關文章
相關標籤/搜索