The Source for Java Technology Collaboration
User: Password:



Jean-Francois Arcand

Jean-Francois Arcand's Blog

Dynamically Adding Virtual Servers in GlassFish

Posted by jfarcand on June 21, 2006 at 06:50 PM | Comments (1)

GlassFish (and SJSAS 9.0) supports a nice feature where you can add virtual-server (host) and http-listener on the fly, without having to reboot the server. You can do it using the admin GUI or the admin CLI. The admin CLI has a nice way to interact with GlassFish, so I will use it first.

Let's add a new virtual-server (make sure GlassFish is running):

% asadmin create-virtual-server -u admin --hosts localhost myHost

That's it. Now let's add a new http-listener so we can do some http transactions:

% asadmin create-http-listener -u admin --listeneraddress 0.0.0.0
--listenerport 8888 --defaultvs myHost --servername localhost.localdomain
 --acceptorthreads 1 myHttpListener

Now you can access the newly created virtual-server and http-listener by just doing:

http://localhost:8888/

For peoples that doesn't like kilometers of typing but like clicks, you can do the same using the admin gui

First, logs in and click on the left tree until you get. vs0.jpg

Enter the required info and press save

vs1.jpg

You should see your newly created virtual-server.

vs2.jpg

Now, for the http-listener, browse the left tree until you get the http-listener screen and click add

hl1.jpg

Enter the required info and press save

hl2.jpg

You should see your newly created http-listener:

hl3.jpg

Then with your browser, just add the new address: test.jpg

C'est tout!!!

Under the hood, the dynamic Grizzly is watching you....

technorati:

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • nice blog, but if you catch enough time and will, would you mind to visit
    this link: Forum post .
    I have a strange problem and I can not distinguish is it
    Sun Application Server problem or router's

    Posted by: eqafrica on November 13, 2006 at 05:25 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds