CATALINA_OPTS='-Djava.rmi.server.hostname=192.168.1.110 \ -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8081 \ -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false'特別注意:
cd /usr/local/tomcat/conf cp /usr/java/jdk1.7.0_71/jre/lib/management/jmxremote.access ./ cp /usr/java/jdk1.7.0_71/jre/lib/management/jmxremote.password.template ./jmxremote.password chmod 600 jmxremote.access jmxremote.passwordjmxremote.access 一般保持原始內容不變即可。
CATALINA_OPTS=" -Djava.rmi.server.hostname=192.168.1.110 -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access -Dcom.sun.management.jmxremote.ssl=false"下載catalina-jmx-remote.jar,放到tomcat/lib目錄下
cd tomcat/lib wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.57/bin/extras/catalina-jmx-remote.jar編輯server.xml:
<?xml version='1.0' encoding='utf-8'?> <Server port="8005" shutdown="SHUTDOWN"> .... <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="8081" rmiServerPortPlatform="8082" />
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 8081 -j ACCEPT iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 8082 -j ACCEPT重啟tomcat
點擊”連接”,進入監控頁面:
原文:http://blog.linuxeye.com/262.html