xml地图|网站地图|网站标签 [设为首页] [加入收藏]
来自 关于我们 2019-10-03 21:50 的文章
当前位置: 新濠国际登录平台 > 关于我们 > 正文

即可开机自动执行,一、在指定目录创建脚本并

 

centos下tomcat自启动,centostomcat启动

 

一、在指定目录创建脚本并赋予755权限

vim /etc/init.d/tomcat

#!/bin/bash
#
# kenny [email protected]
# /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

一、在指定目录创建脚本并赋予755权限 vim /etc/init.d/tomcat #!/bin/ bash## kenny [email protected]# /etc/rc.d/init.d/...

环境:CentOS 6.3,Confluence Wiki

一、在指定目录创建脚本并赋予755权限

做完迁移可正常启动,但Tomcat无法开机启动,经过一番学习终于搞定,记录如下:

vim /etc/init.d/tomcat

1、修改start.sh文件

#!/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

vim /home/wwwroot/tomcat_wiki/bin/startup.sh

 

在文件头增加以下内容:

 

#!/bin/sh

二、在tomcat的配置文件中添加相应参数

# chkconfig: 2345 97 00
#新濠国际登录平台, description:tomcat auto start
#processname: tomcat

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

2、修改catalina.sh文件

本文由新濠国际登录平台发布于关于我们,转载请注明出处:即可开机自动执行,一、在指定目录创建脚本并

关键词: