Hi,
I needed to do this for some testing I'm involved in. Thought it might be useful for others also. I made the changes in the scripts on trunk and tested the build and server.

[1]
Index: catalina.sh
===================================================================
--- catalina.sh (revision 752728)
+++ catalina.sh (working copy)
@@ -60,6 +60,12 @@
 #                   -agentlib:jdwp=transport=$JPDA_TRANSPORT,
# address=$JPDA_ADDRESS,server=y,suspend= $JPDA_SUSPEND
 #
+# JMXREMOTE_OPTS (Optional) Java runtime options used when "jmxremote start"
+#                 command is executed. This command turns on remote jmx
+# access. For JVM defaults, uncomment only the "com.sun. +# management.jmxremote". The other jmxremote properties enable +# finer control and security See: http:// java.sun.com/j2se/1.5.0/docs/guide/management/agent.html.
+#
# JSSE_HOME (Optional) May point at your Java Secure Sockets Extension # (JSSE) installation, whose JAR files will be added to the
 #                   system class path used to start Tomcat.
@@ -234,6 +240,19 @@
   shift
 fi

+if [ "$1" = "jmxremote" ]; then
+   echo "Remote JMX enabled"
+   JMXREMOTE_OPTS="-Dcom.sun.management.jmxremote"
+ JMXREMOTE_OPTS="${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.port=10005"
+   echo "WARNING - Remote JMX is not securely configured"
+# JMXREMOTE_OPTS="${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.access.file=<access-file-path>" +# JMXREMOTE_OPTS="${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.password.file=<password-file-path>" + JMXREMOTE_OPTS="${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.ssl=false" + JMXREMOTE_OPTS="${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.authenticate=false"
+   JAVA_OPTS="${JAVA_OPTS} ${JMXREMOTE_OPTS}"
+   shift
+fi
+
 if [ "$1" = "debug" ] ; then
   if $os400; then
     echo "Debug command not available on OS400"

[2]
Index: startup.sh
===================================================================
--- startup.sh  (revision 752728)
+++ startup.sh  (working copy)
@@ -61,4 +61,7 @@
   fi
 fi

+# Uncomment to enable remote jmx
+#exec "$PRGDIR"/"$EXECUTABLE" jmxremote start "$@"
+
 exec "$PRGDIR"/"$EXECUTABLE" start "$@"


cheers,
-- dave

David Knox
Information System Architect
+1 303-748-8906
http://pragmaticis.blogspot.com





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to