users@glassfish.java.net

Re: Problems with listeners, hosts and multihoming

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Wed, 02 Jul 2008 23:37:40 +0200

glassfish_at_javadesktop.org wrote:
> Hi Wolfgram
>
> What I'm trying to is the same behaviour of Apache or IIS: one single listener and requests routed by host header.
>
> In my configuration I have added additional IPs to /etc/hosts:
> 127.0.0.1 localhost.localdomain localhost
> 10.128.128.31 lvov1.ips
> 10.129.128.32 lvov2.ips
> 10.129.128.33 lvov3.ips
>

This is not necessary for GlassFish - only for you to access the
ncorrect virtual servers by hostname when using a browser on the server
itself. GlassFish _does_ use the hostname. Why this doesn't work for you
- that's the question. /etc/hosts though has nothing to do with it.

> The domain.xml listener and server sections are:
> <http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-1" port="8173" security-enabled="false" server-name="" xpowered-by="true">
> <property name="proxiedProtocols" value="ws/tcp"/>
> </http-listener>
> <virtual-server hosts="localhost, localhost.localdomain" http-listeners="http-listener-1" id="server" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
> <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
> <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
> <property name="sso-enabled" value="false"/>
> </virtual-server>
> <virtual-server default-web-module="A31" hosts="lvov1.ips" http-listeners="http-listener-1" id="S31" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
> <property name="sso-enabled" value="false"/>
> <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
> <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
> </virtual-server>
> <virtual-server default-web-module="A32" hosts="lvov2.ips" http-listeners="http-listener-1" id="S32" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
> <property name="sso-enabled" value="false"/>
> <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
> <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
> </virtual-server>
> <virtual-server default-web-module="A33" hosts="lvov3.ips" http-listeners="http-listener-1" id="S33" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
> <property name="sso-enabled" value="false"/>
> <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
> <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
> </virtual-server>
>

On first glance this looks okay to me. Can you also send the relevant
parts about your webapps (web-module elements of your domain.xml and
also application-ref-elements at the end of domain.xml).

I already asked what you can see in your access log and in server.log.
Anything relvant in there? So given the above confiuration a request to
lvo1.ips should be found in a file like
GF_INSTALL/domains/domain1/logs/access/lvov1_access_log.DATE.txt.

If a request to lvov1.ips gets logged here, your virtual-server settings
are okay, but probably not your webapp-settings or the ref-settings. If
the reqeusts still gets logged in
GF_INSTALL/domains/domain1/logs/access/server_access_log.SOMEDATE.txt
the virtual-server settings should be glanced upon more closely. Thus
please post what happens in your access logs when trying to contact your
site.


> Module A31 is deployed on S31, context /A31; A32 on S32, context /A32 and A33 on S33, context /A33.
>
> Whenever I try to open
> http://lvov1.ips:8173 the docroot page is shown; the same occurs with lvov2 and lvov3
>
> Whenever I try to open
> http://lvov1.ips:8173/A31 a blank, void page is shown without errors on the browser and on the server log. The same happens with lvov2 and lvov3 and any combination of them with A31, A32 and A33.
>
> The goal of this is when url http://lvov1.ips is opened, module /A31 be opened, and so with lvov2.ips - /A32, lvov3.ips - /A33
> [Message sent by forum member 'aperezymadrid' (aperezymadrid)]
>
> http://forums.java.net/jive/thread.jspa?messageID=283572
>

Hope that helps.

--
Wolfram Rittmeyer