You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jesse Farinacci <ji...@gmail.com> on 2012/02/09 16:35:01 UTC
JmxRemoteLifecycleListener binding to all IP addresses
Greetings,
I am using Apache Tomcat 7.0.25 using IBM J9 VM (build 2.4, JRE 1.6.0
IBM J9 2.4 Linux s390x-64 jvmxz6460sr8ifx-20100609_59383).
Inspired by the flurry of JMX related questions on this list, I
attempted to follow the official documentation[1] to enable remote JMX
access. My sanitized conf/server.xml:
<?xml version="1.0" encoding="utf-8"?>
<Server address="a.b.c.d" port="8081">
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="8181" rmiServerPortPlatform="8182" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
readonly="true"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="${catalina.home}/conf/tomcat-users.xml"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector scheme="http" address="a.b.c.d" port="8080"
compression="on" enableLookups="false" URIEncoding="UTF-8"/>
<Connector scheme="https" address="a.b.c.d" port="8443" secure="true"
compression="on" enableLookups="false" URIEncoding="UTF-8"
SSLEnabled="true"
SSLCertificateFile="${catalina.home}/conf/cacert.pem"
SSLCertificateKeyFile="${catalina.home}/conf/privkey.pem"/>
<Engine name="Catalina" defaultHost="vhost.acme.com">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="vhost.acme.com" appBase="webapps" autoDeploy="false"
deployIgnore=".svn" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
pattern="common" resolveHosts="false"/>
<Context path="/manager" privileged="true"/>
</Host>
</Engine>
</Service>
</Server>
I verify that Tomcat thinks this is performing correctly:
logs/catalina.2012-02-09.log:09-Feb-2012 10:27:23.134 INFO
[AsyncFileHandlerWriter-1715627586]
org.apache.catalina.mbeans.JmxRemoteLifecycleListener.createServer The
JMX Remote Listener has configured the registry on port 8181 and the
server on port 8182 for the Platform server
Prior to server start, netstat -a --numeric-ports | grep LIST | grep
8181 shows empty output.
After server start, the same command shows: tcp 0 0 *:8181
*:* LISTEN
This is not good because I have multiple, completely separate,
installations of Tomcat 7.0.25. I want each of them to be able to have
their own JMX on a.b.c.d .. however, it seems that Tomcat is doing a
blanket socket bind despite me coding the IP address. I think it would
be ideal that if a Server address= is coded, that those would be used
when binding JMX. Additionally, to allow coding the hostname to bind
in that Listener.
What is the expected behavior? Is this a bug?
-Jesse
[1] http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#Additional_Implementations
--
There are 10 types of people in this world, those
that can read binary and those that can not.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JmxRemoteLifecycleListener binding to all IP addresses
Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/2/9 Jesse Farinacci <ji...@gmail.com>:
> Greetings,
>
> I am using Apache Tomcat 7.0.25 using IBM J9 VM (build 2.4, JRE 1.6.0
> IBM J9 2.4 Linux s390x-64 jvmxz6460sr8ifx-20100609_59383).
>
> Inspired by the flurry of JMX related questions on this list, I
> attempted to follow the official documentation[1] to enable remote JMX
> access. My sanitized conf/server.xml:
>
> <?xml version="1.0" encoding="utf-8"?>
> <Server address="a.b.c.d" port="8081">
> <Listener className="org.apache.catalina.core.AprLifecycleListener"/>
> <Listener className="org.apache.catalina.core.JasperListener"/>
> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
> <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
> rmiRegistryPortPlatform="8181" rmiServerPortPlatform="8182" />
> <GlobalNamingResources>
> <Resource name="UserDatabase" auth="Container"
> type="org.apache.catalina.UserDatabase"
> readonly="true"
> factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
> pathname="${catalina.home}/conf/tomcat-users.xml"/>
> </GlobalNamingResources>
> <Service name="Catalina">
> <Connector scheme="http" address="a.b.c.d" port="8080"
> compression="on" enableLookups="false" URIEncoding="UTF-8"/>
> <Connector scheme="https" address="a.b.c.d" port="8443" secure="true"
> compression="on" enableLookups="false" URIEncoding="UTF-8"
> SSLEnabled="true"
> SSLCertificateFile="${catalina.home}/conf/cacert.pem"
> SSLCertificateKeyFile="${catalina.home}/conf/privkey.pem"/>
> <Engine name="Catalina" defaultHost="vhost.acme.com">
> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> resourceName="UserDatabase"/>
> <Host name="vhost.acme.com" appBase="webapps" autoDeploy="false"
> deployIgnore=".svn" unpackWARs="true">
> <Valve className="org.apache.catalina.valves.AccessLogValve"
> pattern="common" resolveHosts="false"/>
> <Context path="/manager" privileged="true"/>
> </Host>
> </Engine>
> </Service>
> </Server>
>
> I verify that Tomcat thinks this is performing correctly:
> logs/catalina.2012-02-09.log:09-Feb-2012 10:27:23.134 INFO
> [AsyncFileHandlerWriter-1715627586]
> org.apache.catalina.mbeans.JmxRemoteLifecycleListener.createServer The
> JMX Remote Listener has configured the registry on port 8181 and the
> server on port 8182 for the Platform server
>
> Prior to server start, netstat -a --numeric-ports | grep LIST | grep
> 8181 shows empty output.
> After server start, the same command shows: tcp 0 0 *:8181
> *:* LISTEN
>
> This is not good because I have multiple, completely separate,
> installations of Tomcat 7.0.25. I want each of them to be able to have
> their own JMX on a.b.c.d .. however, it seems that Tomcat is doing a
> blanket socket bind despite me coding the IP address. I think it would
> be ideal that if a Server address= is coded, that those would be used
> when binding JMX. Additionally, to allow coding the hostname to bind
> in that Listener.
>
> What is the expected behavior? Is this a bug?
>
> -Jesse
>
> [1] http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#Additional_Implementations
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
useLocalPorts="true" is what you are needing. It is in the docs [1],
but you may also look at the sources.
As of now there is no option to explicitly configure the IP address to
bind to, but if you want one you may propose a patch. See how
useLocalPorts option is implemented.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JmxRemoteLifecycleListener binding to all IP addresses
Posted by Mark Thomas <ma...@apache.org>.
On 09/02/2012 15:35, Jesse Farinacci wrote:
> What is the expected behavior? Is this a bug?
The expected behaviour is as you describe.
No it is not a bug.
Being able to specify the bind address is an enhancement request that
doesn't look too difficult to implement (and would remove the need for
the useLocalPorts attribute since localhost / 127.0.0.1 / ::1 could be
specified as the host name / address).
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org