<document>
<header>
<product>resin</product>
<title>JMX Consoles</title>
<description>
JMX Consoles provide access to both the MBean's that Resin publishes for
information about and control of the Resin server and Application specific
MBeans.
</description>
</header>

<body>
<summary localtoc="true"/>

<section title="JDK 5.0 and JMX">

<p>
JDK 5.0 includes a JMX implementation that is used to provide 
local and remote administration of a Resin server.
</p>

<example title="Start Resin and allow local JMX administration">
win> ./httpd.exe -Dcom.sun.management.jmxremote
unix> bin/httpd.sh -Dcom.sun.management.jmxremote
</example>

<example title="Start jconsole">
win> jconsole.exe
unix> jconsole

<i>Choose Resin's JVM from the "Local" list.</i>
</example>

<example title="Start Resin and allow remote JMX administration">
win> ./httpd.exe -Dcom.sun.management.jmxremote.port=9999
unix> bin/httpd.sh -Dcom.sun.management.jmxremote.port=9999
</example>

<p>
Without some configuration effort, the previous command will not work.
Password configuration and SSL configuration is required by the JDK
implementation of remote JMX.  Detailed instructions are included in the JDK
documentation.
</p>

<p>
The following is useful for testing, but should be done with caution as the
port is not protected by password or by SSL, and if not protected by a firewall
is accessible by anyone who can guess the port number.
</p>

<example title="Start Resin and remote JMX - disable password checking and SSL"
         size="small">

win> ./httpd.exe -Dcom.sun.management.jmxremote.port=9999
                 -Dcom.sun.management.jmxremote.ssl=false
                 -Dcom.sun.management.jmxremote.authenticate=false

unix> bin/httpd.sh -Dcom.sun.management.jmxremote.port=9999 \
                   -Dcom.sun.management.jmxremote.ssl=false \
                   -Dcom.sun.management.jmxremote.authenticate=false
</example>

<example title="Start jconsole">
win> jconsole.exe
unix> jconsole

<i>Enter the host name and port number (9999) on the "Remote" tab</i>
</example>

<example title="Setting a password for remote JMX access">
$ cd $JAVA_HOME/jre/lib/management
$ cp jmxremote.password.template jmxremote.password
$ chmod u=rw jmxremote.password
$ vi jmxremote.password

<i>Set a password for "monitorRole" and "controlRole":</i>

monitorRole 12monitor
controlRole 55control
</example>

<example title="Start Resin and remote JMX - disable SSL"
         size="small">

win> ./httpd.exe -Dcom.sun.management.jmxremote.port=9999
                 -Dcom.sun.management.jmxremote.ssl=false

unix> bin/httpd.sh -Dcom.sun.management.jmxremote.port=9999 \
                   -Dcom.sun.management.jmxremote.ssl=false

</example>

<example title="Start jconsole">
win> jconsole.exe
unix> jconsole
</example>

<i>Enter the host name and port number (9999) on the "Remote" tab</i>
<i>Enter the username and password on the "Remote" tab</i>
</section>

</body>
</document>
