tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Anderson <riand...@rci.rutgers.edu>
Subject Re: Virtual domains with Tomcat
Date Mon, 23 Jun 2003 14:59:33 GMT
When you use virtual hosts on apache2 with mod_jk2 does Tomcat have to 
have the same virtual hosts defined in it's server.xml file?

--Rick Anderson


John Turner wrote:

>
> Yes.  In general, for every Apache ServerName, you need a 
> corresponding Host entry in Tomcat's server.xml.
>
> The Apache connectors are just pipelines, they do not do any work on 
> behalf of Tomcat.  Thus, when Tomcat receives the request, it has to 
> do the same sort of host header processing that Apache has to do.  If 
> Tomcat cannot find a Host entry that corresponds to the HTTP Host 
> Header it is receiving on the request, it will default to the host 
> name listed in the defaultHost parameter in server.xml.  Apache does 
> the same thing...if it can't find a VirtualHost to match the host 
> header, it defaults to the global VirtualHost, or rather the global 
> ServerName.
>
> The syntax for defining a virtual host in Tomcat's server.xml is 
> different than Apache's httpd.conf, but the principles and concepts 
> are the same.
>
> John
>
> On Mon, 23 Jun 2003 11:00:58 +0200, Nikola Milutinovic 
> <Nikola.Milutinovic@ev.co.yu> wrote:
>
>>> How can I get Tomcat to recognize virtual domains?  This is trivial 
>>> with Apache and I can get Apache to fetch the correct jsp but I 
>>> cannot get timcat to process it.  If I turn off tomcat, apache sends 
>>> the jsp source.  If I turn tomcat on, I get the error 404 page
>>
>>
>> Anything in the logs?
>>
>> I'm not totally sure, but I think you need to match VHosts in your 
>> Apache and your Tomcat. I'll be testing exactly that today with 
>> mod_jk2, Apache 2.0.46 and Tomcat 4.1.24. For mod_webapp it is 
>> definite - you need:
>>
>> <Service ...>
>> <Connector ...>
>> <Engine ...>
>> <Host name="my-vhost.domain.com" ...>
>> <Context docBase="..." path=".."/>
>> ....
>> </Host>
>> </Service>
>>
>> I think the same applies to all other connectors: mod_jk, mod_jk2 and 
>> HTTP.
>>
>> Nix.
>>
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message