二葡京网站spj3355、在tomcat的配置文件中添加相应参数

 

生机勃勃、在内定目录创设脚本并给与755权力

vim /etc/init.d/tomcat

#!/bin/bash
#
# kenny kenny.zhou@tom.com
# /etc/rc.d/init.d/tomcat
# init script for tomcat precesses
#
# processname: tomcat
# description: tomcat is a j2se server
# chkconfig: 2345 86 16
# description: Start up the Tomcat servlet engine.

if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
echo -e "/atomcat: unable to locate functions lib. Cannot continue."
exit -1
fi

RETVAL=$?
CATALINA_HOME="/usr/local/tomcat"

case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
$CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
$CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac

exit $RETVAL

 

 

二、在tomcat的配置文件中增多相应参数

vim /usr/local/tomcat/bin/catalina.sh 

export JAVA_HOME=/usr/local/jdk1.8.0_51/
export CATALINA_HOME=/usr/local/tomcat/
export CATALINA_BASE=/usr/local/tomcat/
export CATALINA_TMPDIR=/usr/local/tomcat/temp

 

三、加多tomcat为系统服务并钦赐在个各种调整台为开机运行格局

chkconfig –add tomcat

chkconfig  tomcat on

chkconfig –list tomcat

 

 

四、server运营验证成功,就能够开机自动实施

service tomcat start