#!/bin/sh
##############################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
##############################################################################
#
# 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:
#
# <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
# <Connector className="org.apache.catalina.connector.http.HttpConnector"
# port="8082" 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
# <Connector port="8082" protocol="HTTP/1.1"
# connectionTimeout="20000"
# maxThreads="2000"
# redirectPort="8443" compression="on" URIEncoding="UTF-8" compressionMinSize="1024" compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" />
JAVA_HOME=/usr/java/default
CATALINA_HOME=/usr/local/tomcat-s
DAEMON_HOME=$CATALINA_HOME
TOMCAT_USER=nobody
# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc.pid
CATALINA_BASE=$CATALINA_HOME
CATALINA_OPTS="-Djava.library.path=/home/jfclere/jakarta-tomcat-connectors/jni/native/.libs"
JAVA_OPTS="-server -Xms8192M -Xmx8192M -XX:PermSize=256m -XX:MaxPermSize=512m"
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/bin/jsvc $JSVC_OPTS \
-user $TOMCAT_USER \
-home $JAVA_HOME \
$JAVA_OPTS\
-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 $JSVC_OPTS \
-stop \
-pidfile $PID_FILE \
org.apache.catalina.startup.Bootstrap
exit $?
;;
*)
echo "Usage tomcat.sh start/stop"
exit 1;;
esac
相关推荐
主要给大家介绍了关于非常实用的Tomcat启动脚本的实现方法,文中通过示例代码介绍的非常详细,对大家学习或者使用Tomcat具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
Tomcat启动停止脚本,直接点击启动或停止脚本即可,可作为服务器计划任务脚本
tomcatomcat6启动脚本t6启动脚本,tomcat6启动脚本tomcat6启动脚本
tomcat自启动脚本
加入系统启动任务,可以监测tomcat运行情况,当tomcat停止服务时,可以自动启动tomcat
Windows系统下 启动tomcat服务bat 可执行脚本,当开发人员想要通过在java中开发一个启动Windows系统下tomcat的脚本文件时,就可以使用我这个
TomcatTomcat启动脚本,配置文件,源码剖析============ Tomcat 7.0.56 RUNNING.txt-安装并运行Tomcat 7.0 Servlet / JSP容器(2014.10.28-) serverStartup.txt-Tomcat 5启动顺序,serverStartup.pdf-启动过程的UML...
linux下tomcat快捷启动脚本,具体使用可参考这个地址的第5步. http://blog.csdn.net/qq1142003960/article/details/48295271
教你如何在linux下配置tomcat自动启动的脚本
tomcat 自启动脚本编写,以及自启动的设置方法。
linux 下 tomcat 管理脚本 启动停止状态等
tomcat10自启动脚本\tomcat服务脚本\tomcat启动脚本 tomcat10 jsvc自启动脚本\tomcat jsvc服务脚本\tomcat jsvc启动脚本
linux和windows启动tomcat脚本
Red hat enterprise linux 5/6/7 平台下,监测tomcat应用down自启动脚本。