blob: 66185ef972cccca12f2356fd6b545ed59c3c5e0b [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>5.4&nbsp;Starting with JMX Access Modifications</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Virgo User Guide"><link rel="up" href="ch05.html" title="5.&nbsp;Starting and Stopping Virgo Tomcat Server"><link rel="prev" href="ch05s03.html" title="5.3&nbsp;Starting in Debug Mode"><link rel="next" href="ch05s05.html" title="5.5&nbsp;Starting with a Custom Configuration Directory"><!--Begin Google Analytics code--><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2728886-3");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
</script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.4&nbsp;Starting with JMX Access Modifications</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s03.html">Prev</a>&nbsp;</td><th width="60%" align="center">5.&nbsp;Starting and Stopping Virgo Tomcat Server</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch05s05.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1262"></a>5.4&nbsp;Starting with JMX Access Modifications</h2></div></div></div>
The Virgo Tomcat Server always starts with JMX access enabled, allowing you to use a management tool such as JConsole
to attach to the Web Server instance.
By default both local access and remote access over SSL with username and password
authentication are provided. The default port for secure JMX access is <code class="literal">9875</code>
and the default username and password are <code class="literal">admin</code> and <code class="literal">springsource</code>.
<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e1275"></a>Linux</h3></div></div></div><p>
To start Virgo Tomcat Server with default JMX access enabled, run <code class="literal">startup.sh</code> passing
in no arguments:
</p><pre class="screen">prompt$ cd $SERVER_HOME
prompt$ bin/startup.sh </pre><p>
To start JConsole, run the <code class="literal">jconsole.sh</code> script, located in the <code class="literal">bin</code> directory, as shown:
</p><pre class="screen">prompt$ cd $SERVER_HOME
prompt$ bin/jconsole.sh </pre><p>
The following image shows how to specify a local connection using JConsole.
</p><p>
<img src="images/jmx-local-attach.png">
</p><p>
The following image shows how to specify a remote connection in JConsole that uses SSL with the default
username/password (<code class="literal">admin/springsource</code> and default secure port of <code class="literal">9875</code>).
</p><p>
<img src="images/jmx-remote-attach-default.png">
</p><p>
To start with the JMX remote access on a specific port number other than the default <code class="literal">9875</code>,
pass this port number in as the value
of the <code class="literal">-jmxport</code> argument:
</p><pre class="screen">prompt$ cd $SERVER_HOME
prompt$ bin/startup.sh -jmxport 9090</pre><p>
This will start the Virgo Tomcat Server with JMX enabled for remote connections on port <code class="literal">9090</code>.
</p><p>
<img src="images/jmx-remote-attach-jmxport.png">
</p><p>To start the JMX remote access with a custom username and password, update the <code class="literal">$SERVER_HOME/config/org.eclipse.virgo.kernel.users.properties</code> file. First specify the custom username by changing the value of the <code class="literal">role.admin</code> property. Then set the password of this new user by adding a new property called <code class="literal">user.<span class="emphasis"><em>username</em></span></code>, where <code class="literal"><span class="emphasis"><em>username</em></span></code> refers to the actual name of the user. Finally, restart VTS for the changes to take effect.</p><p>For example, if you want change the JMX remote access username to <code class="literal">zebedee</code> with password <code class="literal">florence</code>, change the file as follows:
</p><pre class="programlisting">##################
# User definitions
##################
user.zebedee=florence
##################
# Role definitions
##################
role.admin=zebedee</pre><p>Specify the custom username in JConsole as shown. </p><p>
<img src="images/jmx-remote-attach-jmxusers.png">
</p><p>
To start the JMX remote access using a custom SSL certificate, edit the file located at
<code class="literal">$SERVER_HOME/config/keystore</code>. If you wish to use a different keystore,
pass this filename in as the value for the <code class="literal">-keystore</code> argument and the keystore
password in as the value for the <code class="literal">-keystorePassword</code> argument:
</p><pre class="screen">prompt$ cd $SERVER_HOME
prompt$ bin/startup.sh -keystore customKeystore -keystorePassword customKeystorePassword</pre><p>
This will start the Virgo Tomcat Server with JMX enabled for remote connections using an SSL certificate from
<code class="literal">customKeystore</code> with a password of <code class="literal">customKeystorePassword</code>.
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e1386"></a>Microsoft Windows</h3></div></div></div><p>
To start Virgo Tomcat Server with default JMX access enabled, run <code class="literal">startup.bat</code> passing
in no arguments:
</p><pre class="screen">prompt&gt; cd %SERVER_HOME%
prompt&gt; bin\startup.bat</pre><p>
To start JConsole, run the <code class="literal">jconsole.bat</code> script, located in the <code class="literal">bin</code> directory, as shown:
</p><pre class="screen">prompt&gt; cd %SERVER_HOME%
prompt&gt; bin\jconsole.bat </pre><p>
The following image shows how to specify a local connection using JConsole.
</p><p>
<img src="images/jmx-local-attach.png">
</p><p>
The following image shows how to specify a remote connection in JConsole that uses SSL with the default
username/password (<code class="literal">admin/springsource</code> and default secure port of <code class="literal">9875</code>).
</p><p>
<img src="images/jmx-remote-attach-default.png">
</p><p>
To start with the JMX remote access on a specific port number other than the default <code class="literal">9875</code>,
pass this port number in as the value of the <code class="literal">-jmxport</code> argument:
</p><pre class="screen">prompt&gt; cd %SERVER_HOME%
prompt&gt; bin\startup.bat -jmxport 9090</pre><p>
This will start the Virgo Tomcat Server with JMX enabled for remote connections on port
<code class="literal">9090</code>.
</p><p>
<img src="images/jmx-remote-attach-jmxport.png">
</p><p>To start the JMX remote access with a custom username and password, update the <code class="literal">%SERVER_HOME%\config\org.eclipse.virgo.kernel.users.properties</code> file. First specify the custom username by changing the value of the <code class="literal">role.admin</code> property. Then set the password of this new user by adding a new property called <code class="literal">user.<span class="emphasis"><em>username</em></span></code>, where <code class="literal"><span class="emphasis"><em>username</em></span></code> refers to the actual name of the user. Finally, restart VTS for the changes to take effect.</p><p>For example, if you want change the JMX remote access username to <code class="literal">zebedee</code> with password <code class="literal">florence</code>, change the file as follows:
</p><pre class="programlisting">##################
# User definitions
##################
user.zebedee=florence
##################
# Role definitions
##################
role.admin=zebedee</pre><p>Specify the custom username in JConsole as shown. </p><p>
<img src="images/jmx-remote-attach-jmxusers.png">
</p><p>
To start the JMX remote access using a custom SSL certificate, edit the file located at
<code class="literal">%SERVER_HOME%\config\keystore</code>. If you wish to use a different
keystore, pass this filename in as the value for the <code class="literal">-keystore</code> argument and the
keystore password in as the value for the <code class="literal">-keystorePassword</code> argument:
</p><pre class="screen">prompt&gt; cd %SERVER_HOME%
prompt&gt; bin\startup.bat -keystore customKeystore -keystorePassword customKeystorePassword</pre><p>
This will start the Virgo Tomcat Server with JMX enabled for remote attach using an SSL certificate from
<code class="literal">customKeystore</code> with a password of <code class="literal">customKeystorePassword</code>.
</p></div></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript">
_lf_cid = "LF_48be82fa";
_lf_remora();
</script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s03.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch05s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.3&nbsp;Starting in Debug Mode&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;5.5&nbsp;Starting with a Custom Configuration Directory</td></tr></table></div></body></html>