在tomcat下面配置域名(如:>环境:
*** 作系统均为:CentOS 51
Apache2X服务器一台:IP地址1921682324;安装路径/usr/local/apache;
Tomcat6服务器一台:IP地址1921682325;安装路径/usr/local/tomcat;
Tomcat6服务器一台:IP地址1921682326;安装路径/usr/local/tomcat;
配置:
Apache安装:
#/configure --prefix=/usr/local/apache --enable-modules=so --enable-mods-shared=all --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy->方法一:
linux 下tomcat开机自启动
修改Tomcat/bin/startupsh 为:
export JAVA_HOME=/usr/java/j2sdk142_08
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/toolsjar:$JAVA_HOME/lib/dtjar:
export PATH=$PATH:$JAVA_HOME/bin
export CATALINA_HOME=/usr/local/tomcat
/usr/local/tomcat/bin/catalinash start
在/etc/rcd/rclocal中加入:
/usr/local/tomcat/bin/startupsh
方法二:
1、把下面的代码保存为tomcat文件,并让它成为可执行文件 chmod 755 tomcat
#!/bin/bash
#
# kenny kennyzhou@tomcom
# /etc/rcd/initd/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/initd/functions ]; then
/etc/initd/functions
elif [ -f /etc/rcd/initd/functions ]; then
/etc/rcd/initd/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/startupsh ];
then
echo $"Starting Tomcat"
$CATALINA_HOME/bin/startupsh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdownsh ];
then
echo $"Stopping Tomcat"
$CATALINA_HOME/bin/shutdownsh
fi
;;
)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
2、将tomcat文件拷贝到/etc/initd/下,并运行:
chkconfig --add tomcat
3、在tomcat/bin/catalinash文件中加入以下语句:
export JAVA_HOME=/YOURPATH/tomcat/jdk
export CATALINA_HOME=/YOURPATH/tomcat
export CATALINA_BASE=/YOURPATH/tomcat
export CATALINA_TMPDIR=/YOURPATH/tomcat/temp
启动tomcat:
service tomcat start
停止tomcat:
service tomcat stop
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)