Changing Default GlassFish v3 Prelude Port Numbers 4848, 8080, and 8181
By dgolds on Dec 22, 2008
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:
To change the HTTP port to 10080:
asadmin set server.http-service.http-listener.http-listener-1.port=10080
To change the HTTPS port to 10443:
asadmin set server.http-service.http-listener.http-listener-2.port=10443
To change the administration server port to 14848:
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.