geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@alumni.princeton.edu>
Subject Re: Virtual Hosts
Date Mon, 16 Jan 2006 20:52:43 GMT
OK, let me try to concoct a still more explicit example, to help me
understand what's going on in Tomcat.

Let's say your box as one network card, and, of course, the loopback address:

lo
eth0

With 2 IPs assigned to the network card:

lo
  127.0.0.1
eth0
  192.168.1.12
  192.168.1.13

And each of those IPs has two host names assigned:

lo
  127.0.0.1
    localhost
eth0
  192.168.1.12
    clubs.cards.com
    spades.cards.com
  192.168.1.13
    diamonds.cards.com
    hearts.cards.com

Now we have one Tomcat listener by default:

Listener HTTP @ 0.0.0.0
  127.0.0.1
    localhost
  192.168.1.12
    clubs.cards.com
    spades.cards.com
  192.168.1.13
    diamonds.cards.com
    hearts.cards.com

And we have one Tomcat Host by default:

Host TomcatHost, name=localhost
  127.0.0.1
    localhost

So as far as I can tell, in our default configuration, since the only
Tomcat Host GBean is given a name parameter of "localhost", we only
support virtual hosting for "localhost" without additional user
configuration (deploying Host GBeans)?  Or do we only support any
traffic at all to "localhost"?  I haven't tried Tomcat from a remote
machine.

Anyway, let's say I have two applications, "Poker" and "Pinochle", and
I want Poker to be available on hearts.cards.com and spades.cards.com,
and I want Pinochle to be available on spades.cards.com and
clubs.cards.com.  Is that possible?  If so, what Host objects would
need to be added, and how would the Poker and Pinochle applications be
bound to them?  And is there any explicit relationship between
Listener and Host other than them being in the same Container?

Thanks,
    Aaron

On 1/16/06, Jeff Genender <jgenender@apache.org> wrote:
>
>
> David Jencks wrote:
>
> > To clarify, the tomcat and jetty interpretations of the multiple virtual
> > host elements in an ejb web service plan are completely unrelated:
> > -- jetty: the vh elements are actually used as virtual host names
> > -- tomcat: the first vh element if present is used to find a tomcat host
> > object, whose name has nothing to do with any aliases/virtual host names.
>
> I don't agree here.  According to the Tomcat doc, the Host name is
> "Network name of this virtual host, as registered in your Domain Name
> Service server."  So it is a virtual host name.  Where I think where the
> code can be expanded is searching the alias name for a match in case the
> name is not the same as the VH.  This is probably a good thing to add.
>
> Jeff
>

Mime
View raw message