|
Tomcat example source code file (monitoring.xml)
The Tomcat monitoring.xml source code<?xml version="1.0"?> <!-- 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. --> <!DOCTYPE document [ <!ENTITY project SYSTEM "project.xml"> ]> <document url="monitoring.html"> &project; <properties> <author email="pero@apache.org">Peter Rossbach <author email="remm@apache.org">Remy Maucherat <title>Monitoring and Managing Tomcat </properties> <body> <section name="Introduction"> <p>Monitoring is a very important question today. Looking inside the running server, grab some statistic data or reconfigure some aspects are daliy adminstration tasks.</p> </section> <section name="Enabling JMX Remote"> <p>The Sun website includes the list of options and how to configure JMX Remote on Java 5: <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html"> http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html</a>. </p> <p>For quick installation you find here a short installation guide: <p>Add the following parameters to your tomcat startup script: <source> set CATALINA_OPTS="-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=%my.jmx.port% \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false" </source> </p> <p> <ol> <li>When you think authorisation is a good, add and change this : <source> -Dcom.sun.management.jmxremote.authenticate=true \ -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password \ -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access \ </source> </li> <li>edit the access allow file $CATALINA_BASE/conf/jmxremote.access : <source> monitorRole readonly controlRole readwrite </source> </li> <li>edit the password file $CATALINA_BASE/conf/jmxremote.password : <source> monitorRole tomcat controlRole tomcat </source> <b>Tipp: Password File must be readonly and not accessable from every other user! Remove all other users under windows to access this file. </li> </ol> <b>Note:The JSR 160 JMX-Adaptor opens a second data protocol port. That is a problem when you have installed a local firewall.<br/> </p> <p>Activate JMX MX4J Http Adaptor with Java 1.4: <ol> <li>Install the tomcat compat package <li>Install the mx4j-tools.jar at common/lib. Please, use the same MX4j version as your tomcat release</li> <li>Configure a MX4J JMX HTTP Adaptor at your AJP Connector <p> <source> <Connector port="${AJP.PORT}" handler.list="mx" mx.enabled="true" mx.httpHost="${JMX.HOST}" mx.httpPort="${JMX.PORT}" protocol="AJP/1.3" /> </source> </p> <p>Tipp: With ${AJP.PORT}=0 no ajp connection where started. </p> <p>Note: MX4J JSR 160 RMI Adaptor to support JDK 1.4 currently not integrated. </p> </li> <li>Start your tomcat and look with a browser at http://${JMX.HOST}:${JMX.PORT} <li>With the mx connector parameter |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.