Hello,

You need a single mod_jk.conf and a single worker.properties. You need to write it 
yourself: you declare your two tomcats into workers.properties, and for getting your 
mod_jk.conf, you merge your 2 mod_jk.conf.auto, but when you make the mapping for the 
dynamic part of a webapp (servlets or jsps) you have to specify on which tomcat to 
sent the request.

For example, if you have a "foo" webapp in a tomcat1, and a "bar" webapp in a tomcat2:

in workers.properties, you need something like:
worker.list=ajp_tomcat1,ajp_tomcat2
worker.ajp_tomcat1.port=8007
worker.ajp_tomcat1.host=localhost
worker.ajp_tomcat1.type=ajp12
worker.ajp_tomcat2.port=8009
worker.ajp_tomcat2.host=localhost
worker.ajp_tomcat2.type=ajp12

and in mod_jk.conf, something like:
JkMount /foo/servlet/* ajp_tomcat1
JkMount /foo/*.jsp ajp_tomcat1
JkMount /bar/servlet/* ajp_tomcat2
JkMount /bar/*.jsp ajp_tomcat2

Xavier Marjou

> -----Original Message-----
> From: Abhijat Thakur [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, September 07, 2001 7:16 PM
> To:   [EMAIL PROTECTED]
> Subject:      RE: Multiple Tomcat Instances
> 
> I am using two tomcats
> server1.xml
>       AJP on Port 8007
> server2.xml
>       AJP on port 8009
> I am using Http via Apache.Every time i start tomcat with one of server.xml
> files i rename the mod_jk.conf-auto and the included the two static files in
> httpd.conf. Even after doing this i can only go to the contexts served by
> server1.xml file and not by server2.xml. How do i tell apache as to which
> context is to be serverd by which port. I think i am missing this step but
> do not know how to do it?
> 
> Thanks
> 
> Abhijat Thakur
> 
> 
> -----Original Message-----
> From: Marjou Xavier [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 07, 2001 4:37 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Multiple Tomcat Instances
> 
> 
> Hello,
> 
> Each Tomcat can be interfaced with a HTTP client with 2 different ways
> (defined in server.xml)
> - either with regular HTTP (eg: on port 8080)
> - or/and indirectly via Apache (AJP protocol is used, eg port 8007)
> If you use HTTP via Apache, Apache will need mod_jk.conf and
> worker.properties to know how to dialogue with Tomcat
> If you use only one instance of Tomcat, then the default files (server.xml,
> mod_jk.conf-auto and worker.properties) work well.
> 
> 
> Now if you use 2 Tomcats,  you can do:
> - in server1.xml
>       - HTTP on port 8080)
>       - AJP on port 8007)
> -in server2.xml
>       - HTTP on port 8081)
>       - AJP on port 8009)
> Each Tomcat will have its own socket for serving HTTP. It is not possible to
> share a socket (eg: 8080) between to Tomcats as you are trying to do.
> 
> If you use HTTP via Apache, Apache will need to write your own mod_jk.conf
> and worker.properties. (It is important to realize that the default ones are
> working only when there is the default configuration of Tomcat (ie: only one
> Tomcat)).
> 
> I hope this help,
> Xavier Marjou
> 
> 
> 
> 
> 

Reply via email to