不需要认证:
set CATALINA_OPTS=-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=8899 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false
|
需要认证:
set CATALINA_OPTS=-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=8899 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=true \ -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password \ -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access \
|
$CATALINA_BASE/conf/jmxremote.access
monitorRole readonly controlRole readwrite
|
$CATALINA_BASE/conf/jmxremote.password
monitorRole tomcat controlRole tomcat
|
/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
#
LANG=zh_CN.GBK
JAVA_HOME=/usr/java/jdk1.6.x
CATALINA_HOME=/web/tomcat
DAEMON_HOME=/web/tomcat/bin/commons-daemon-1.0.2-native-src/unix
TOMCAT_USER=tomcat
# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc.pid
CATALINA_BASE=/web/tomcat
CATALINA_OPTS="-Xms2048m -Xmx2048m -XX:PermSize=64m -XX:MaxPermSize=128m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8899 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.library.path=/usr/local/apr/lib:/web/tomcat/bin/commons-daemon-1.0.2-native-src/unix"
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 \
-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.log \
-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 \
-stop \
-pidfile $PID_FILE \
org.apache.catalina.startup.Bootstrap
exit $?
;;
*)
echo "Usage tomcat.sh start/stop"
exit 1;;
esac
|
阅读(2118) | 评论(1) | 转发(0) |