users@glassfish.java.net

How do you bind all glassfish TCP ports to fixed port numbers for firewall?

From: <glassfish_at_javadesktop.org>
Date: Wed, 30 Apr 2008 05:00:23 PDT

A running glassfish process serves on a number of TCP ports. Some of the ports served on are configured in the domain.xml but others are dynamic, as you can see in the lsof output below.

Now I've found that one of these dynamic ports can be bound to a fixed port by putting a imq.jms.tcp.port property into domains/<domain>/imq/instances/imqbroker/props/config.properties file.

What other obscure or not so obscure glassfish settings should I be defining to bind all the dynamically allocated ports to fixed numbers?

Here's the lsof command I use to show the TCP ports listening from the glassfish process:

[root_at_localhost ~]# lsof -P | grep "4328.*TCP.*LISTEN"
java 4328 dcampbel 90u IPv6 1994482 TCP localhost.localdomain:40393 (LISTEN) [dynamic, bound to localhost]
java 4328 dcampbel 104u IPv6 1994569 TCP *:3700 (LISTEN) [iiop defined in domain.xml]
java 4328 dcampbel 108u IPv6 1994571 TCP *:3820 (LISTEN) [iiop over ssl defined in domain.xml]
java 4328 dcampbel 110u IPv6 1994578 TCP *:3920 (LISTEN) [iiop over ssl with mutual auth defined in domain.xml]
java 4328 dcampbel 117u IPv6 1994630 TCP *:8686 (LISTEN) [admin service jmx connector defined in domain.xml]
java 4328 dcampbel 119u IPv6 1994634 TCP *:48455 (LISTEN) [dynamic]
java 4328 dcampbel 122u IPv6 1994893 TCP *:8080 (LISTEN) [http defined in domain.xml]
java 4328 dcampbel 128u IPv6 1994664 TCP *:7676 (LISTEN) [defined in domain.xml]
java 4328 dcampbel 135u IPv6 1994679 TCP *:38965 (LISTEN) [dynamic]
java 4328 dcampbel 139u IPv6 1994686 TCP *:59968 (LISTEN) [dynamic]
java 4328 dcampbel 140u IPv6 1994687 TCP *:59772 (LISTEN) [dynamic]
java 4328 dcampbel 212u IPv6 1994921 TCP *:8181 (LISTEN) [admin https defined in domain.xml]
java 4328 dcampbel 216u IPv6 1994927 TCP *:5858 (LISTEN) [admin http defined in domain.xml]
[Message sent by forum member 'dcam' (dcam)]

http://forums.java.net/jive/thread.jspa?messageID=272207