geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@mortbay.com>
Subject Re: Virtual Hosts
Date Tue, 17 Jan 2006 11:21:17 GMT
Jeff Genender wrote:
> 
> Aaron Mulder wrote:
> 
>>All right, hang on.
>>
>>Let's say you have App A that wants virtual hosts 1, 2, and 3 and App
>>B that wants virtual hosts 2, 3, and 4.
>>
>>Tomcat can have Host123 listening on 1, 2, and 3 and Host234 listening
>>on 2, 3, and 4, and App A bound to Host123 and App B bound to Host234?
> 
> 
> No....IIU what you are trying to say...
> 
> Lets differentiate between listening on an IP and VH.  The IP address
> that one listens on is controlled by the connector, not the host.

Indeed.

moreover. it may even be controlled by a remote load balancer (Eg apache
forwarding requests via mod_jk) and the IP/port that the connector
is listening on is unrelated to the real host.


> The host controls which DNS resolved name it responds to...i.e.
> www.example.com, etc.  You would only use an IP address for a VH if your
> user actually uses the ip address in the URL, since this ultimately is
> where the decision is made.  This is rarely the case of ever.

and then there is no requirement for it to be a real IP address.
virtual host names can be anything.     

If you ever want to hide an easter egg on a public website, picking
a fake virtual host name would be a cute way to do it.


> So, using your example above, assuming 1,2,3,4 are the DNS resolved
> names, the setup is invalid.  Host123 and Host234 cannot share listening
> for VH 2 and 3.  

In Jetty it is possible to have an app responding to real hosts 123 and
another responding to 234.

To do so you have your connector listen to 0.0.0.0 (ie all real hosts
which should include 1234) or you can have 4 connectors, one each for
1,2,3 and 4.

You can then set the real hosts on each webapp.  Set 123 on app A
and 234 on app B and you have it.

I'm not sure this is a common situation.  However I have certainly
seen

  App A responds to real hosts 123
  App B responds only to host    3

This would be where 1 and 2 are two public IPs and 3 is a private
admin IP.










Mime
View raw message