tomcat脚本启动命令

编程

#!/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=tomcat8
JAVA_HOME=/usr/java/jdk1.8.0_151/  # 根据自己的路径改写JAVA_HOME
export JAVA_HOME
CATALANA_HOME=/usr/local/tomcat/   # 根据自己的路径改写CATALANA_HOME
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

以上是 tomcat脚本启动命令 的全部内容, 来源链接: utcz.com/z/517647.html

回到顶部