users@glassfish.java.net

Re: How to access subdomain from same port

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Thu, 04 Feb 2010 11:02:28 -0800

On 02/ 4/10 10:13 AM, glassfish_at_javadesktop.org wrote:
> Thanks Jan for your advice, but it doesn't work.
>
> Here is my setup:
>
> I have an enterprise app deployed to GF v2.1. The app has the following modules:
>
> EJBmodule
> abcModule -> is web app domain abc.com
> xyzModule -> is web app subdomain xyz.abc.com
>
> Virtual server: server
> Hosts: abc.com
> Http Listeners: http-listener-1, http-listener-2
> Default Web Module: myapp#abc.war
>
> Virtual server: myserver
> Hosts: xyz.abc.com
> Http Listeners: http-listener-1
> Default Web Module: myapp#xyz.abc.war
>
> Access abc.com serves abc.com welcome page.
> Access xyz.abc.com serves an empty page, no messages in server.log.
> Access xyz.abc.com:8080 serves Http Status 503 page.
>
> What do I wrong?
>

I just tried this myself (GF v2.1.1), and it's working as expected.

This is what I did:

1. Launch admingui
2. Edit the virtual-server with id "server", and add "abc.com"
(separated by comma)
    to its Hosts field
3. Create new virtual-server with id "myserver", enter "xyz.abc.com" in its
    Hosts field and "http-listener-1" in its "HTTP Listeners" field.
4. Deploy an EAR file mytest.ear that contains two WAR files: foo.war
and bar.war
5. Edit the virtual-server with id "server" and select "mytest#foo.war"
as its
    "Default Web Module"
6. Edit the virtual-server with id "myserver" and select
"mytest#bar.war" as its
    "Default Web Module"

7. % telnet localhost 8080 [where 8080 is the port# of http-listener-1]
     GET / HTTP/1.1
     Host: abc.com

     => Verify that the welcome page from "mytest#foo.war" is served.

8. % telnet localhost 8080
     GET / HTTP/1.1
     Host: xyz.abc.com

     => Verify that the welcome page from "mytest#bar.war" is served.

Jan

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