怎样快速启动tomcat服务器

发布网友 发布时间:2022-04-22 06:37

我来回答

1个回答

热心网友 时间:2023-10-18 17:11

1、建立启动脚本(/etc/init.d/tomcat)
#
# !/bin/bash
# Description: start or stop the tomcat
# Usage: tomcat [start|stop|reload|restart]
# Author: Wang Yinghui
# Date: Thu Apr 26, 2007
#

export PATH=$PATH:$HOME/bin
export BASH_ENV=$HOME/.bashrc
export USERNAME="root"

case "$1" in
start)
#startup the tomcat
echo -n "tomcat start: "
cd /home/tomcat-5.5.20/bin/
. myconfig.sh
./startup.sh
cd /home/tomcat-5.5.20_second
. myconfig.sh
./startup.sh
echo "finished"
;;
stop)
# stop tomcat
echo -n "tomcat stop:"
ps -ef | grep "java" | grep -v grep | sed 's/ [ ]*/:/g'|cut -d: -f2| kill -9 `cat`
echo "finished"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: tomcat [start|stop|reload|restart]"
exit 1

esac
exit 0

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com