On 10.06.2009 15:42, R Ravichandran wrote:
> Rainer,
> Here is my problem. I have a host with one IP address mapped to two domain
> names, let us say www.app1.com and www.app2.com served by two web apps
> running on Tomcat say webapp1 and webapp2.
> 
> I have Apache Tomcat config. setup to forward any requests coming for any of
> these two domain names to be routed to Tomcat.
> 
> My problem is both of these web apps need to be the ROOT applications on
> Tomcat, and somehow the right app must be executed based on the incoming
> domain name. How do I setup both apps. as root context and Vhost on Tomcat.

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

> On Wed, Jun 10, 2009 at 12:58 AM, Rainer Jung <rainer.j...@kippdata.de>wrote:
> 
>> On 10.06.2009 06:00, R Ravichandran wrote:
>>> Hello,
>>>
>>> This is an urgent request. Any feedback is really appreciated.
>>>
>>> I have two web applications (let us call main app., and helper app.)
>> running
>>> on Tomcat with an Apache server in from of Tomcat. Both Apache and Tomcat
>>> are running on the same host. The first web app on Tomcat is running as
>> ROOT
>>> webapp.
>>>
>>> I have two websites mapped to the single IP address of the host. I want
>> the
>>> right application accessed depending on the domain name used.
>>>
>>> - For example, for the domain name "www.app1.com, I want the first
>> tomcat
>>> web app reached.
>>> - for the domain name "www.app2.com" I want the second web app reached.
>>>
>>> Here is the config, I am using:
>>> =
>>> In Apache httpd.conf file:
>>>
>>> NameVirtualHost *:80
>>>
>>> <VirtualHost www.app1.com>
>>>   ServerName www.app1.com
>>>   ProxyPreserveHost On
>>>   ProxyPass / http://localhost:8080/app1
>>>   ProxyPassReverse / http://localhost:8080/app1
>>> </VirtualHost>
>>>
>>> <VirtualHost www.app2.com>
>>>     ServerName www.app2.com
>>>   ProxyPreserveHost On
>>>   ProxyPass /totelistm http://localhost:8080/app2
>>>   ProxyPassReverse /totelistm http://localhost:8080/app2
>>> </VirtualHost>
>>>
>>>
>>> Here is the uriworkmap.properties file for mod_jk
>>> worker.list=loadbalancer,status
>>>
>>> /=loadbalancer
>>> /*=loadbalancer
>>>
>>> /app2=loadbalancer
>>> /app2/*=loadbalancer
>> You forgot to tell us, what your actual problem is.
>>
>> Remarks:
>>
>> - I don't understand, why you want to use mod_proxy *and* mod_jk. Choose
>> one of them, not both.
>>
>> - You can use virtual hosts in Tomcat too and put each webapp as the
>> ROOT context in the respective vhost.
>>
>> - When using mod_proxy make sure to use ProxyPreserveHost to forward the
>> original Hosts header, so that Tomcat can choose the correct vhost.
>>
>> Regards,
>>
>> Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to