免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1490 | 回复: 0
打印 上一主题 下一主题

Tomcat6开机启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-09 18:59 |只看该作者 |倒序浏览

一:修改/usr/local/apache-tomcat-6.0.13/conf目录下的tomcat-users.xml文件,修改后文件内容为:
  
  
  

二:进入tomcat/bin目录
tar -zxf jsvc.tar.gz
cd jsvc-src/
sh support/buildconf.sh
chmod +x ./configure
./configure --with-java=/opt/jdk1.6.0_05/
make
cd native/
vi Tomcat5.sh  ####修改所有路径为包安装路径,修改tomcat进程用户
cp Tomcat5.sh /etc/rc.d/init.d/tomcat
cd /etc/rc.d/init.d/
chmod +x tomcat
chkconfig --add tomcat
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/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
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   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.
#chkconfig: 2345 85 15
#description: apache-tomcat.6
##############################################################################
#
# 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:
#
#   
#   
#
# That is for Tomcat-5.0.x (Apache Tomcat/5.0)
#
# Adapt the following lines to your configuration
#JAVA_HOME=/home2/java/j2sdk1.4.2_03
#CATALINA_HOME=/home/tomcat5/tomcat5/jakarta-tomcat-5/build
#DAEMON_HOME=/home/jfclere/daemon
#TOMCAT_USER=tomcat5
JAVA_HOME=/opt/jdk1.6.0_05
CATALINA_HOME=/opt/tomcat
DAEMON_HOME=/opt/tomcat/bin
TOMCAT_USER=XXXXXXXXX
# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc.pid
CATALINA_BASE=/opt/tomcat
#CATALINA_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.jar
case "$1" in
  start)
    #
    # Start Tomcat
    #
    #$DAEMON_HOME/src/native/unix/jsvc \
    $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 $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/src/native/unix/jsvc \
    $DAEMON_HOME/jsvc-src/jsvc \
    -stop \
    -pidfile $PID_FILE \
    org.apache.catalina.startup.Bootstrap
    exit $?
    ;;
  *)
    echo "Usage tomcat.sh start/stop"
    exit 1;;
esac
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
注意路径


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/73175/showart_1077095.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP