gamester88
gamester88_cu
全部博文(159)
2010年(39)
2009年(106)
2008年(14)
zhaiqi16
cynthia
52246852
ghsyeu
dj15621
lmt81858
笑倚春风
JenGuo
求上进
分类: LINUX
2009-06-01 12:44:13
[root@tomcat ~]# cd /opt/tomcat/bin/[root@tomcat bin]# lsbootstrap.jar catalina-tasks.xml digest.bat service.bat shutdown.bat startup.sh tomcat-juli.jar tool-wrapper.shcatalina.bat commons-daemon.jar digest.sh setclasspath.bat shutdown.sh tomcat6.exe tomcat-native.tar.gz version.batcatalina.sh cpappend.bat jsvc.tar.gz setclasspath.sh startup.bat tomcat6w.exe tool-wrapper.bat version.sh[root@tomcat bin]# tar zxvf jsvc.tar.gz [root@tomcat bin]# cd jsvc-src/[root@tomcat jsvc-src]# chmod +x configure[root@tomcat jsvc-src]# ./configure --with-java=/opt/java[root@tomcat jsvc-src]# make[root@tomcat jsvc-src]# cp /opt/tomcat/bin/jsvc-src/native/Tomcat5.sh /etc/rc.d/init.d/[root@tomcat jsvc-src]# cd /etc/rc.d/init.d/[root@tomcat init.d]# chmod +x Tomcat5.sh [root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc0.d/K90tomcat5.sh[root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc1.d/K90tomcat5.sh[root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc2.d/S90tomcat5.sh[root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc3.d/S90tomcat5.sh[root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc4.d/S90tomcat5.sh[root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc5.d/S90tomcat5.sh[root@tomcat init.d]# ln -s /etc/init.d/tomcat5.sh /etc/rc6.d/K95tomcat5.sh[root@tomcat init.d]# more Tomcat5.sh #!/bin/sh################################################################################ Copyright 2004 The Apache Software Foundation.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## ## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.################################################################################ 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 configurationJAVA_HOME=/opt/javaCATALINA_HOME=/opt/tomcatDAEMON_HOME=/opt/tomcatTOMCAT_USER=root# for multi instances adapt those lines.TMP_DIR=/var/tmpPID_FILE=/var/run/jsvc.pidCATALINA_BASE=/opt/tomcatCATALINA_OPTS="-Djava.library.path=/home/jfclere/jakarta-tomcat-connectors/jni/native/.libs"CLASSPATH=\$JAVA_HOME/lib/tools.jar:\$CATALINA_HOME/bin/commons-daemon.jar:\$CATALINA_HOME/bin/bootstrap.jarcase "$1" in start) # # Start Tomcat # $DAEMON_HOME/bin/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 $CATALINA_HOME/logs/catalina.out \ -errfile '&1' \ $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/bin/jsvc-src/jsvc \ -stop \ -pidfile $PID_FILE \ org.apache.catalina.startup.Bootstrap exit $? ;; *) echo "Usage tomcat.sh start/stop" exit 1;;esac[root@tomcat init.d]# /etc/rc.d/init.d/Tomcat5.sh start[root@tomcat init.d]# netstat -tnlActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 :::8009 :::* LISTEN tcp 0 0 :::8080 :::* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::22 :::* LISTEN [root@tomcat init.d]# /etc/rc.d/init.d/Tomcat5.sh stop[root@tomcat init.d]# netstat -tnlActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::22 :::* LISTEN [root@tomcat init.d]# useradd tomcatadmin[root@tomcat init.d]# vi Tomcat5.sh TOMCAT_USER=tomcatadmin 改为这样[root@tomcat /]# chown -R tomcatadmin:tomcatadmin /opt/tomcat[root@tomcat /]# netstat -tnlActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::22 :::* LISTEN [root@tomcat /]# /etc/rc.d/init.d/Tomcat5.sh start[root@tomcat /]# netstat -tnlActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 :::8009 :::* LISTEN tcp 0 0 :::8080 :::* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::22 :::* LISTEN [root@tomcat /]# /etc/rc.d/init.d/Tomcat5.sh stop[root@tomcat /]# netstat -tnlActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::22 :::* LISTEN [root@tomcat /]# vi /etc/rc.d/init.d/Tomcat5.sh 在#!/bin/sh下面加入#chkconfig: 2345 85 15#description: 任意内容[root@tomcat /]# chkconfig --level 345 Tomcat5.sh on[root@tomcat /]# init 6
上一篇:Apache 2.2 + Tomcat 6.0 + MySQL 5.0 + mod_jk 整合
下一篇:awstats的安装
登录 注册