users@glassfish.java.net

Re: Virtual Hosting

From: <Jan.Luehe_at_Sun.COM>
Date: Fri, 21 Sep 2007 18:25:41 -0700

Dick Davies wrote:

>On 20/09/2007, Jan.Luehe_at_sun.com <Jan.Luehe_at_sun.com> wrote:
>
>
>>Hi Kem,
>>
>>Kem Elbrader wrote:
>>
>>
>>
>>>I want all request to *.somedomain.com to default to a particular web
>>>module where the * can be anything such as 'www' or 'admin'. Is this
>>>possible. If so how would I go about setting it up?
>>>
>>>
>>>
>>>
>>unfortunately, GlassFish does not support wildcards in host (domain)
>>names.
>>
>>
>
>Sounds like name-based virtual hosting is out.
>
>

No, what I meant was that the web container does not support
wildcards in the alias names (i.e., the comma-separated names
specified as the value of the "hosts" attribute) of a virtual server,
when it attempts to map the host name of a request to one of the
available virtual servers.
(But that does not mean that named-based virtual hosting "is out"
in general.)

So, you won't be able to configure a GlassFish virtual
server with an alias name of the form "*.somedomain.com"
and expect that any requests with a host name of
"www.somedomain.com" or "admin.somedomain.com" be
mapped to this virtual server, even if you've configured the
necessary mappings at the DNS level.

For this to work, you will have to specify both "www.somedomain.com"
and "admin.somedomain.com" as alias names in your virtual server's
"host" attribute.

As I mentioned before, if you feel that this feature is important,
please go ahead and file an RFE.

Thanks,


Jan

>But wouldn't this work if you had an IP-based glassfish host e.g. www.domain.com
>and then setup the wildcard in DNS
>(so *.domain.com is a CNAME to www.domain.com)?
>
>
>