Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 69325 invoked from network); 26 Nov 2003 07:15:05 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 26 Nov 2003 07:15:05 -0000 Received: (qmail 88908 invoked by uid 500); 26 Nov 2003 07:14:19 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 88708 invoked by uid 500); 26 Nov 2003 07:14:18 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 88686 invoked from network); 26 Nov 2003 07:14:17 -0000 Received: from unknown (HELO mail.gipex.com) (202.76.88.55) by daedalus.apache.org with SMTP; 26 Nov 2003 07:14:17 -0000 Received: from srini.gipex.com ([210.0.219.48]) by mail.gipex.com (8.10.2+Sun/8.10.0) with ESMTP id hAQ7Dtm14584 for ; Wed, 26 Nov 2003 15:13:55 +0800 (CST) Message-Id: <5.2.1.1.0.20031126151526.028434b8@mail.gipex.com> X-Sender: srinivas@mail.gipex.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Wed, 26 Nov 2003 15:16:24 +0800 To: "Tomcat Users List" From: "Venkata Srinivasa Rao, Yerra" Subject: Re: Virtual host with Squid, Apache and Tomcat Mime-Version: 1.0 Content-Type: multipart/mixed; x-avg-checked=avg-ok-FAA3C6D; boundary="=======2FF24348=======" X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=======2FF24348======= Content-Type: multipart/alternative; x-avg-checked=avg-ok-FAA3C6D; boundary="=====================_19441144==.ALT" --=====================_19441144==.ALT Content-Type: text/plain; x-avg-checked=avg-ok-FAA3C6D; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit Hi, As far as I know, we can do it in both workers2.properties and httpd.conf (virtual hosts). It seems some problem in apache side virtual host configuration for the same uri for example ServerName www.abc.com DocumentRoot .... JkUriSet worker channel.socket:192.168.1.10:8008 JkUriSet vhost www.abc.com JkUriSet context /eng JkUriSet worker channel.socket:192.168.1.10:8009 JkUriSet vhost www.abc.com JkUriSet context /fre ServerName www.xyz.com DocumentRoot .... JkUriSet worker channel.socket:192.168.1.11:8008 JkUriSet vhost www.xyz.com JkUriSet context /eng JkUriSet worker channel.socket:192.168.1.11:8009 JkUriSet vhost www.xyz.com JkUriSet context /fre www.abc.com virtual host pattern will be overwritten by www.xyz.com virtual host pattern. You can find it in jkstatus page. Always you will be redirected to 192.168.1.11 tomcats, in other words you will always reach www.xyz.com site even you come from www.abc.com . Please let me know if you can find the solution. To fix the above problem you can use workers2.properties as follows [channel.socket:192.168.1.10:8008] info=Ajp13 forwarding over socket to 10-8008 tomcat tomcatId=abc_eng lb_factor=1 debug=0 [channel.socket:192.168.1.10:8009] info=Ajp13 forwarding over socket to 10-8009 tomcat tomcatId=abc_fre lb_factor=1 debug=0 [channel.socket:192.168.1.11:8008] info=Ajp13 forwarding over socket to 11-8008 tomcat tomcatId=xyz_eng lb_factor=1 debug=0 [channel.socket:192.168.1.11:8009] info=Ajp13 forwarding over socket to 11-8009 tomcat tomcatId=xyz_fre lb_factor=1 debug=0 [uri:www.abc.com/eng/*] info=ABC Eng context=/eng group=abc_eng debug=0 [uri:www.abc.com/fre/*] info=ABC Fre context=/eng group=abc_fre debug=0 [uri:www.xyz.com/eng/*] info=XYZ Eng context=/eng group=xyz_eng debug=0 [uri:www.xyz.com/fre/*] info=XYZ Fre context=/eng group=xyz_fre debug=0 At 04:25 PM 11/21/2003 +0100, you wrote: >Hi > >I'm new to the list, so... hi! :-) > >Here's our scenario: We use Squid as a reverse proxy cache in front of >Apache which in return calls Tomcat for dynamic content: > >Browser --> Squid --> Apache --> Tomcat > >Until now we used the old mod_webapp, but now we're changing to mod_jk2 >(with Apache 1.3 and Tomcat 4.1). We need to have several hosts on the same >Apache and thus use virtual hosts. The problem is that the web applications >sometimes need to have the same name. > >An example: > >www.abc.com has two web applications, one for each language (ISO codes): >www.abc.com/eng/ and www.abc.com/fre/ (French) >www.def.com also has two web applications which are different, but have the >same name: www.def.com/eng/ and www.def.com/fre/ > >Now, with the old mod_webapp, all we had to do is define a unique name for >each of those (we chose a three-letter acronmy of the site plus the web >application name), in this case "abc_eng", "abc_fre", "def_eng" and >"def_fre" and point to them in the virtual host definition of Apache, like >this: > > ServerName www.abc.com > DocumentRoot .... > WebAppDeploy abc_eng /eng > WebAppDeploy abc_fre /fre > > > ServerName www.def.com > DocumentRoot .... > WebAppDeploy def_eng /eng > WebAppDeploy def_fre /fre > > >As far as I can see, with mod_jk2, this is not possible in Apache alone. Am >I right? > >I read on a couple of pages how Tomcat can be configured for virtual >hosting, but I think these examples were all assuming that you use Tomcat as >the web server. From what I understand I would need to define something like >this in server.xml: > > > > > > > > > >Another problem which may arise is that the domain names point to Squid, >thus Apache only responds to the IP address. Frankly, I don't know exactly >how Apache does the DNS lookup, and I know there's a parameter in the >server.xml that enables DNS lookups. Surely, this is necessary for this >scenario to work? > >Anyway, in a nutshell: Has anybody ever done this? Will this work? > >Any help is greatly appreciated! > >Thanks & best regards, >Eric > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org ---------- Best Regards, Venkata Srinivasa Rao, Yerra Gips Limited. mail: srinivas@gipex.com mobile: (852) 6191-5545 home: (852) 2807-2521 office: (852) 2104-5551 fax: (852) 2104-5550 web: http://www.gipalbum.com web: http://www.gipex.com ---------- --=====================_19441144==.ALT Content-Type: text/html; x-avg-checked=avg-ok-FAA3C6D; charset=us-ascii Content-Transfer-Encoding: 8bit Hi,

        As far as I know, we can do it in both workers2.properties and httpd.conf (virtual hosts). It seems some problem in apache side virtual host configuration for the same uri  for example

<VirtualHost ....>
        ServerName www.abc.com
        DocumentRoot ....
       <Location "/eng/*">
                JkUriSet worker channel.socket:192.168.1.10:8008
                JkUriSet vhost www.abc.com
                JkUriSet context /eng
       </Location>
       <Location "/fre/*">
                JkUriSet worker channel.socket:192.168.1.10:8009
                JkUriSet vhost www.abc.com
                JkUriSet context /fre
       </Location>
</VirtualHost>

<VirtualHost ....>
        ServerName www.xyz.com
        DocumentRoot ....
       <Location "/eng/*">
                JkUriSet worker channel.socket:192.168.1.11:8008
                JkUriSet vhost www.xyz.com
                JkUriSet context /eng
       </Location>
       <Location "/fre/*">
                JkUriSet worker channel.socket:192.168.1.11:8009
                JkUriSet vhost www.xyz.com
                JkUriSet context /fre
       </Location>
</VirtualHost>

        www.abc.com virtual host pattern will be overwritten by www.xyz.com virtual host pattern. You can find it in jkstatus page. Always you will be redirected to 192.168.1.11 tomcats, in other words you will always reach www.xyz.com site even you come from www.abc.com . Please let me know if you can find the solution.

To fix the above problem you can use workers2.properties as follows

[channel.socket:192.168.1.10:8008]
info=Ajp13 forwarding over socket to 10-8008 tomcat
tomcatId=abc_eng
lb_factor=1
debug=0

[channel.socket:192.168.1.10:8009]
info=Ajp13 forwarding over socket to 10-8009 tomcat
tomcatId=abc_fre
lb_factor=1
debug=0

[channel.socket:192.168.1.11:8008]
info=Ajp13 forwarding over socket to 11-8008 tomcat
tomcatId=xyz_eng
lb_factor=1
debug=0

[channel.socket:192.168.1.11:8009]
info=Ajp13 forwarding over socket to 11-8009 tomcat
tomcatId=xyz_fre
lb_factor=1
debug=0

[uri:www.abc.com/eng/*]
info=ABC Eng
context=/eng
group=abc_eng
debug=0

[uri:www.abc.com/fre/*]
info=ABC Fre
context=/eng
group=abc_fre
debug=0

[uri:www.xyz.com/eng/*]
info=XYZ Eng
context=/eng
group=xyz_eng
debug=0

[uri:www.xyz.com/fre/*]
info=XYZ Fre
context=/eng
group=xyz_fre
debug=0

At 04:25 PM 11/21/2003 +0100, you wrote:

Hi

I'm new to the list, so... hi!  :-)

Here's our scenario: We use Squid as a reverse proxy cache in front of
Apache which in return calls Tomcat for dynamic content:

Browser  --> Squid  -->  Apache  -->  Tomcat

Until now we used the old mod_webapp, but now we're changing to mod_jk2
(with Apache 1.3 and Tomcat 4.1). We need to have several hosts on the same
Apache and thus use virtual hosts. The problem is that the web applications
sometimes need to have the same name.

An example:

www.abc.com has two web applications, one for each language (ISO codes):
www.abc.com/eng/ and www.abc.com/fre/ (French)
www.def.com also has two web applications which are different, but have the
same name: www.def.com/eng/ and www.def.com/fre/

Now, with the old mod_webapp, all we had to do is define a unique name for
each of those (we chose a three-letter acronmy of the site plus the web
application name), in this case "abc_eng", "abc_fre", "def_eng" and
"def_fre" and point to them in the virtual host definition of Apache, like
this:
<VirtualHost ....>
        ServerName www.abc.com
        DocumentRoot ....
        WebAppDeploy  abc_eng /eng
        WebAppDeploy  abc_fre /fre
</VirtualHost>
<VirtualHost ....>
        ServerName www.def.com
        DocumentRoot ....
        WebAppDeploy  def_eng /eng
        WebAppDeploy  def_fre /fre
</VirtualHost>

As far as I can see, with mod_jk2, this is not possible in Apache alone. Am
I right?

I read on a couple of pages how Tomcat can be configured for virtual
hosting, but I think these examples were all assuming that you use Tomcat as
the web server. From what I understand I would need to define something like
this in server.xml:
<Host name="www.abc.com" debug="0" appBase="webapps" unpackWARs="true">
        <Context path="/eng" docBase="abc_eng" debug="0" reloadable="true"/>
        <Context path="/fre" docBase="abc_fre" debug="0" reloadable="true"/>
</Host>
<Host name="www.def.com" debug="0" appBase="webapps" unpackWARs="true">
        <Context path="/eng" docBase="def_eng" debug="0" reloadable="true"/>
        <Context path="/fre" docBase="def_fre" debug="0" reloadable="true"/>
</Host>

Another problem which may arise is that the domain names point to Squid,
thus Apache only responds to the IP address. Frankly, I don't know exactly
how Apache does the DNS lookup, and I know there's a parameter in the
server.xml that enables DNS lookups. Surely, this is necessary for this
scenario to work?

Anyway, in a nutshell: Has anybody ever done this? Will this work?

Any help is greatly appreciated!

Thanks & best regards,
Eric


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


Best Regards,
Venkata Srinivasa Rao, Yerra
Gips Limited.
mail: srinivas@gipex.com
mobile: (852) 6191-5545
home: (852) 2807-2521
office: (852) 2104-5551
fax: (852) 2104-5550
web: http://www.gipalbum.com
web: http://www.gipex.com

--=====================_19441144==.ALT-- --=======2FF24348======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-FAA3C6D Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003 --=======2FF24348======= Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --=======2FF24348=======--