users@glassfish.java.net

Re: Problems with listeners, hosts and multihoming

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Mon, 30 Jun 2008 22:54:33 +0200

glassfish_at_javadesktop.org wrote:
> Hello
>
> I want GF to serve different applications if requested from different hosts. So I've added three IP addresses to my eth0, I've declared them in an external DNS with different names: lvov1.ips, lvov2.ips and lvov3.ips. Machine name is localhost.localdomain and no host aliases are included in /etc/hosts file.
>
> Then I've created three servers in GF with hosts value: lvov1.ips, lvov2.ips and lvov3.ips. I've changed the host value of server 'server' to [b]localhost, localhost.localdomain[/b]. All four servers connected to the default non-SSL listener.
>
> Then I've deployed three simple jsf applications in each one of the servers, each one in context /A1, /A2 and /A3. No default server module has been selected.
>
> When I try to go to http://lvov.ips:8173 or http://lvov.ips:8173/A1, I get the usual fault page as if that url is not present, and the same happens with lvov2.ips and lvov3.ips; and with applications A2 and A3.

Is this lvov.ips or lvov1.ips? If I understand you correctly only
hostnames localhost, lvov1.ips, lvov2.ips or lvov3.ips are supported by
your configuration.

>
> I am wondering if the hosts value in each server is intended to route requests based on the host header value. Is there any other configuration value missing?

Yes, the hostname header is used. Thus you can telnet to localhost on
your server and using the correct header can still verify your settings.

Actually setting up some virtual servers and deploying the webapps to
the correct virtual server should be enough. Is there anything in your
server.log?

It might also help to switch access logging on and check which virtual
server serves your requests.

Furthermore you might Want to also have a look at
http://blogs.sun.com/jluehe/entry/virtual_hosting_features_in_glassfish


--
Wolfram Rittmeyer
> 
> I've also tried to create three listeners to the same port for each IP alias, but in that case GF doesn't start due to port conflict. But each listener was defined for each IP.
> 
> Thanks,
> [Message sent by forum member 'aperezymadrid' (aperezymadrid)]
> 
> http://forums.java.net/jive/thread.jspa?messageID=283437
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> 
>