users@glassfish.java.net

Re: Any way to change a Listener port on the fly?

From: Dies Koper <dies_at_jp.fujitsu.com>
Date: Tue, 18 Sep 2007 09:29:19 +0900

I haven't tried if it works, but is this what you are looking for?

asadmin set server.http-service.http-listener.http-listener-1.port=8081
asadmin set server.http-service.http-listener.http-listener-1.enabled=false
<start Apache HTTPD>

And then change things back when you're done:
asadmin set server.http-service.http-listener.http-listener-1.port=80
asadmin set server.http-service.http-listener.http-listener-1.enabled=true

Regards,
Dies

glassfish_at_javadesktop.org wrote:
> Now, Jeanfrancois, if I wanted the users to be greeted by nasty error
> pages, I would simply kick the network cable out of the computer
> during the upgrade and be done with it! :-)
>
> However, it looks like there MIGHT be hope here for me.
>
> If I can simply disable the 80 listener, then I can quickly get
> Apache up and running to take over port 80 and present
> something...friendlier.
>
> Unfortunately, there's a bug in GF right now that seems to require me
> to restart it when my application changes.
>
> Also, there doesn't seem to be a mechanism to actually CHANGE a
> listener via a command line, rather it seems I can only create and
> delete them.
>
> And I don't know if I can delete a listener that has a virtual server
> deployed against it, and I don't know if I can delete a VS that has
> an app deployed against it. So, I don't think I can simply delete and
> then quickly re add a listener without actually removing the
> applications (I may be wrong -- I know you can't remove the default
> application for a VS, for example).
>
> So, I guess the meaty question is whether it's possible through
> playing with the appropriate MBean directly to make these changes. I
> mean, if I get the MBean to a listener and simply set the port to
> something else, will it Do The Right Thing.
>
> I might be able to do all this by hand (via the GUI), but it doesn't
> look like I can easily script this, at least not without potentially
> some custom Java code to work the MBean directly vs using asadmin to
> do the heavy lifting. [Message sent by forum member 'whartung'
> (whartung)]
>
> http://forums.java.net/jive/thread.jspa?messageID=235675