参考tomcat documentation,实现tomcat随linux启动而启动。详细内容如下:
http://tomcat.apache.org/tomcat-5.5-doc/setup.html
-----------------------------------------------------------
Unix daemonTomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK.Before running the script, the JAVA_HOME environment variable should be set to the base path of the JDK. Alternately, when calling the ./configure script, the path of the JDK may be specified using the --with-java parameter, such as ./configure --with-java=/usr/java.Using the following commands should result in a compiled jsvc binary, located in the $CATALINA_HOME/bin folder. This assumes that GNU TAR is used, and that CATALINA_HOME is an environment variable pointing to the base path of the Tomcat installation.注:楼主这样做最大弊端是拖缓系统启动,没有什么意义。
http://tomcat.apache.org/tomcat-5.5-doc/setup.html
-----------------------------------------------------------
Unix daemonTomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK.Before running the script, the JAVA_HOME environment variable should be set to the base path of the JDK. Alternately, when calling the ./configure script, the path of the JDK may be specified using the --with-java parameter, such as ./configure --with-java=/usr/java.Using the following commands should result in a compiled jsvc binary, located in the $CATALINA_HOME/bin folder. This assumes that GNU TAR is used, and that CATALINA_HOME is an environment variable pointing to the base path of the Tomcat installation.注:楼主这样做最大弊端是拖缓系统启动,没有什么意义。
解决方案 »
- 求助!Struts2和Extjs整合的问题
- 请教高手,SSH框架配置问题
- 关于c3p0的问题 请大家踊跃发言 若是高手就多说几句
- Myeclipse中ssh问题求救????????
- 哪位高手做过容器外调用tomcat的数据池的呀。
- 一个完成的项目,现在要加cache,有意见可以给么,应该如何着手,有JCS的资料么?
- 埃帕信息-开源工作流发布!!
- 大家在处理sqlserver的text类型时,用hibernate是怎么处理的??
- 关于JNDI配置文件config.properties的问题
- 关于Spring拦截器拦截路径通配符的问题
- jsp中无法建立数据库连接池
- ServletException in 'login.jsp': No getter method for property rand of bean org.apache.struts.taglib.html.BEAN
# systems) and linked to /etc/rc3.d/S99tomcat and /etc/rc0.d/K01tomcat.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description: A servlet/jsp container.# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: honbo
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 3 5
# Short-Description: start and stop tomcat
# Description: A servlet/jsp container.
### END INIT INFO
basedir=/data/tomcat5# Set some defaultspid_file=
if test -z "$basedir"
then
basedir=/data/admin/tomcat
bindir=/data/admin/tomcat/bin
else
bindir="$basedir/bin"
fiPATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
#add by honbo
JAVA_HOME=/usr/java/j2sdk1.4.2_08
CLASSPATH=$JAVA_HOME/lib/tools.jar:.
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME CLASSPATH#end add by honbo
export PATH
mode=$1 # start or stop# Safeguard (relative paths, core dumps..)
cd $basedircase "$mode" in
'start')
# Start daemon #if test -x $bindir/startup.sh
#then
$bindir/startup.sh
#else
# echo "Can't execute $bindir/startup.sh from dir $basedir"
#fi
;; 'stop')
$bindir/shutdown.sh
# echo "No tomcat stop sh file found. Looked for $bindir/shutdown.sh."
;; 'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
$0 stop
$0 start
;; *)
# usage
echo "Usage: $0 start|stop|restart"
exit 1
;;
esac