分类: Java
2009-10-14 17:37:04
TOMCAT 6.0 自动启动
安装jsvc
shell>cd /usr/local/tomcat6/bin
shell>tar xvfz jsvc.tar.gz
shell>cd jsvc-src
shell>sh support/buildconf.sh
如果成功,命令终端打印出下面report:
support/buildconf.sh: configure script generated successfully
#安装autoconf : rpm -ivh autoconf-2.59-12.noarch.rpm imake-
shell>chmod 755 configure
shell>./configure --with-java=/usr/java/jdk
shell>make
/etc/init.d/tomcat
#!/bin/sh
#
# Start Script for Tomcat 6
#
# chkconfig: 35 92 84
# description: Tomcat6 Daemon
# processname: jsvc
# pidfile: /var/run/jsvc.pid
#
# Small shell script to show how to start/stop Tomcat using jsvc
# If you want to have Tomcat running on port 80 please modify the server.xml
# file:
#
#
#
# port="80" minProcessors="5" maxProcessors="75"
# enableLookups="true" redirectPort="8443"
# acceptCount="10" debug="0" connectionTimeout="60000"/>
#
# That is for Tomcat-5.0.x (Apache Tomcat/5.0)
#
# Adapt the following lines to your configuration
LANG=zh_CN.GBK
JAVA_HOME=/usr/java/jdk
CATALINA_HOME=/web/tomcat1
DAEMON_HOME=/web/tomcat1/bin
TOMCAT_USER=tomcat
# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc.pid
CATALINA_BASE=/web/tomcat1
JAVA_OPTS="-Xms
CATALINA_OPTS="-Xms
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar
case "$1" in
start)
#
# Start Tomcat
#
$DAEMON_HOME/jsvc-src/jsvc \
-user $TOMCAT_USER \
-home $JAVA_HOME \
-Dcatalina.home=$CATALINA_HOME \
-Dcatalina.base=$CATALINA_BASE \
-Djava.io.tmpdir=$TMP_DIR \
-wait 10 \
-pidfile $PID_FILE \
-outfile /web/logs/tomcat.out \
-errfile /web/logs/error.log \
$CATALINA_OPTS \
-cp $CLASSPATH \
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-verbose \
# To get a debug of jsvc.
#-debug \
exit $?
;;
stop)
#
# Stop Tomcat
#
$DAEMON_HOME/jsvc-src/jsvc \
-stop \
-pidfile $PID_FILE \
org.apache.catalina.startup.Bootstrap
exit $?
;;
*)
echo "Usage tomcat.sh start/stop"
exit 1;;
esac
#checkconfig –add tomcat