centos 7 tomcat 开机启动

前端之家收集整理的这篇文章主要介绍了centos 7 tomcat 开机启动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

[root@localhost ~]# vi /etc/init.d/tomcat_uc

#!/bin/bash
#

tomcat startup script for the Tomcat server

#
#

chkconfig: 345 80 20

description: start the tomcat deamon

#

Source function library

. /etc/rc.d/init.d/functions

prog=tomcat_uc
JAVA_HOME=/usr/local/jdk
export JAVA_HOME
CATALANA_HOME=/usr/local/webserver/tomcat_uc
export CATALINA_HOME

case "$1" in
start)
echo "Starting Tomcat..."
$CATALANA_HOME/bin/startup.sh
;;

stop)
echo "Stopping Tomcat..."
$CATALANA_HOME/bin/shutdown.sh
;;

restart)
echo "Stopping Tomcat..."
$CATALANA_HOME/bin/shutdown.sh
sleep 2
echo
echo "Starting Tomcat..."
$CATALANA_HOME/bin/startup.sh
;;

*)
echo "Usage: $prog {start|stop|restart}"
;;
esac
exit 0

chmod +x /etc/init.d/tomcat_uc注意centos 7 [root@localhost init.d]# pwd/etc/init.d[root@localhost init.d]# systemctl stop tomcat_uc.service[root@localhost init.d]# systemctl start tomcat_uc.service[root@localhost init.d]#

原文链接:https://www.f2er.com/centos/374643.html

猜你在找的CentOS相关文章