Monday December 22, 2008
Changing Default GlassFish v3 Prelude Port Numbers 4848, 8080, and 8181
When you create courses, you sometimes do crazy things like installing multiple GlassFish domain administration servers (DAS) in a single host.
When you install GlassFish, it gives you default port numbers of of 4848 (for administration), 8080 (for the HTTP listener), and 8181 (for the HTTPS listener). But what do you do if you want to change them?
I got a few ideas googling "asadmin port number" and the like but couldn't really find a good example. So, I figured out how you do it and thought I would post an example in case anyone finds themselves in the same predicament as I did today.
Here are some examples that work in GlassFish v3 Prelude:
asadmin set server.http-service.http-listener.http-listener-1.port=10080
asadmin set server.http-service.http-listener.http-listener-2.port=10443
asadmin set server.http-service.http-listener.admin-listener.port=14848
It's handy to know you can grep for server properties in GlassFish v3 Prelude as follows:
asadmin get server | grep listener
shows all the properties with the text "listener" in them.
asadmin set --port 14848 server.http-service.http-listener.http-listener-2.port=10443
For GlassFish v2, use the asadmin get command as described here.
Hope this is helpful to someone.
Posted at 05:27PM Dec 22, 2008 by dgolds in Open Source | Comments[9]
Great, now what about the like 14 other ports that GlassFish opens by default? I basically want http->https (which I mostly handle in the load balancer) and https -> opensso, maybe admin. It opens a handful of other ports for "other purposes" ? What are they for, what do I need them for? Should I be using them instead of https?
~tommy
Posted by Tommy McNeely on December 22, 2008 at 08:44 PM PST #
You can also change the ports from the get-go by editing setup.xml - just look (iirc) for 'port'.
Posted by Pat Patterson on December 23, 2008 at 02:14 AM PST #
Tommy, I ran this command:
/opt/glassfish/instance1/bin/asadmin get --port 14848 server | grep port
(My instance's admin port is 14848)
And got this:
iiop-service.iiop-listener.orb-listener-1.port=3700
iiop-service.iiop-listener.SSL.port=3820
jms-service.jms-host.default_JMS_host.port=7676
http-service.http-listener.http-listener-2.port=10443
http-service.http-listener.http-listener-1.port=10080
admin-service.jmx-connector.system.port=8686
iiop-service.iiop-listener.SSL_MUTUALAUTH.port=3920
http-service.http-listener.admin-listener.port=14848
I'm no expert on GlassFish but it would seem like:
- The 3 IIOP ports are associated with default IIOP listeners
- The jms port is associated with the JMS provider
- The jmx port is associated with the JMX connector server
So that leaves the http listener ports, and listener-2.port is the HTTPS port as I described in my blog entry.
Posted by David Goldsmith on December 23, 2008 at 08:58 AM PST #
Pat, I'm not sure how you do that for GF v3 Prelude. With GF v2, you have to run ant -f setup.xml after you do the initial installation, so you can modify setup.xml as you said. But with v3 Prelude, there's no any step - the installer does everything for you.
I guess there must be a way to do this with v3 Prelude - anyone who know it, please post a comment here.
Posted by David Goldsmith on December 23, 2008 at 09:39 AM PST #
You could also simply use the admin console..
Dirk
Posted by Dirk on December 26, 2008 at 03:20 PM PST #
On Windows did not wok:
c:\Program Files\glassfish-v2ur2\bin>asadmin get --port 6769 server
Please enter the admin user name>admin
Please enter the admin password>adminadmin
No value name specified = server
CLI137 Command get failed.
Any idea ?
BRs,
M.
Posted by Martin Novoty on January 20, 2009 at 03:10 PM PST #
Martin, the examples I gave in my blog entry were specifically for GlassFish v3 Prelude. This was not obvious in the original blog entry, so I've edited that entry now to clarify.
I provided a link for asadmin syntax for GlassFish v2 in the revised entry.
HTH,
David
Posted by David Goldsmith on January 20, 2009 at 06:54 PM PST #
Thanks a lot dgolds!!!!
You made my day :)
Posted by edulan on May 18, 2009 at 02:00 AM PDT #
Thank you so much! I love finding pages like this that save hours of going through documentation.
Posted by randy on October 31, 2009 at 02:30 PM PDT #