users@glassfish.java.net

Re: How to access subdomain from same port

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 03 Feb 2010 09:50:05 -0800

On 02/ 3/10 08:44 AM, glassfish_at_javadesktop.org wrote:
> Is there really no way to access subdomains from the same port? That can even be done in Tomcat.
>

GlassFish supports a more fine-grained association between virtual servers
and http listeners, so whatever works in Tomcat will also work in GlassFish.

I think what you are trying to do is the following:

1. Add "abc.com" to the host (domain) names of virtual-server "server"
2. Create virtual-server "myserver" and assign "xyz.abc.com" as its
   domain name
3. Have "server" and "myserver" be associated with the same set of
   http-listeners (in particular, http-listener-1)
4. Deploy a webapp abc.war and declare it as the default-web-module
   of "server"
5. Deploy a different webapp xyz.war and declare it as the
   default-web-module of "myserver"
6. Access abc.com:8080 (where 8080 is the port number of http-listener-1)
   and expect it to serve the welcome page of abc.war
7. Access xyz.abc.com:8080 and expect it to serve the welcome page of
   xyz.war

This should work, that is, the longest domain name match should
determine the target virtual server to which the request will be
dispatched.

Jan

> [Message sent by forum member 'bardubitzki' (stephan_at_bardubitzki.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=384551
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>