> Date: Mon, 14 May 2012 10:37:07 +0200
> From: a...@ice-sa.com
> To: users@tomcat.apache.org
> Subject: Re: Multiple tomcat Instances on Same Server and One Apache Instance
> 
> Pid * wrote:
> > On 13 May 2012, at 20:33, "André Warnier" <a...@ice-sa.com> wrote:
> > 
> >> Pid wrote:
> >>> On 11/05/2012 18:53, Vickie Troy-McKoy wrote:
> >>>> Hi, I am in need of a little help.
> >>>> I have 2 tomcat instances running on the same machine and one apache 
> >>>> instance running on a different machine.  I configured jk_mod to access 
> >>>> the 1st tomcat instance.  Now, I have a second tomcat instance running 
> >>>> on the same server as the 1st instance.  I would like to access both 
> >>>> tomcat instances via the one apache webserver instance.  Because some 
> >>>> requests are referenced by the same name, there is a conflict.
> >>>> On the tomcat server in server.xml, one instance is running on port 8009 
> >>>> and the 2nd instance (in another directory structure) is running on 7009.
> >>>>
> >>>> On the apache server in httpd.conf, I have the following:
> >>>>
> >>>> Listen 80
> >>>> .
> >>>> .
> >>>> .
> >>>> LoadModule jk_module modules/mod_jk.so
> >>>>
> >>>> #
> >>>> JkWorkersFile conf/workers.properties
> >>>> JkMount /abc* instance1
> >>>> JkMount /xyz* instance2
> >>>>
> >>>> In workers.properties, I have the following:
> >>>>
> >>>> worker.list=instance1, instance2
> >>>> #
> >>>> worker.instance1.port=8009
> >>>> worker.instance1.host=server.xxxx.com
> >>>> worker.instance1.type=ajp13
> >>>> worker.instance1.lbfactor=1
> >>>> worker.instance1.socket_keepalive=1
> >>>> #
> >>>> worker.instance2.port=7009
> >>>> worker.instance2.host=server.xxxx.com
> >>>> worker.instance2.type=ajp13
> >>>> worker.instance2.lbfactor=1
> >>>> worker.instance2.socket_keepalive=1
> >>>>
> >>>> When I call abc*, it goes to instance1; and when I call xyz*, it goes to 
> >>>> instance2.  However, both instances have apps that start with "tsa".  
> >>>> How do I configure the apache webserver to service the "tsa" app for 
> >>>> both tomcat instances?
> >>> configure a load balancer (worker) that uses the (other) two workers, in 
> >>> addition to the
> >>> two workers, and add it to the worker list.
> >> I think that rather than be added to the workers list, the load-balancer 
> >> worker must be the only one in the list.  You then tell the balancer to 
> >> balance the two other workers.
> > 
> > Then the two individual apps won't work, as they're not present on both 
> > servers.
> 
> Oh. I did not read the OP's requirements carefully enough.  Apologies, your 
> instructions 
> were correct for the OP.
--------------------------------------------------- 

Thank you all for your suggestions.  I tried configuring a load balancer 
worker; however,  I'm getting HTTP 500 messages--Internal Server Error.  I 
reviewed the reference page; however, apparently, I'm missing something.  Also 
in the mod_jk.log, there's an error stating:   "Could not find worker with name 
'instance2' in uri map post processing".  Any ideas?  Thank you...

On the apache server in httpd.conf, I changed the JKMount statements because I 
wanted to access all content.

 Listen 80
 .
 .
 .
 LoadModule jk_module modules/mod_jk.so

 #
 JkWorkersFile conf/workers.properties
 JkMount /* instance1
 JkMount /* instance2

 In workers.properties, added the load balancer information; it reflects the 
following:

 worker.balance1.type=lb
 worker.balance1.balance_workers=instance1, instance2
 #
 worker.instance1.port=8009
 worker.instance1.host=server.xxxx.com
 worker.instance1.type=ajp13
  
 #
 worker.instance2.port=7009
 worker.instance2.host=server.xxxx.com
 worker.instance2.type=ajp13


On the tomcat server (which is the same server), I added the jvmRoute setting 
in server.xml.  For instance one, I added:

     <Engine name="Catalina" defaultHost="localhost" jvmRoute="instance1">

For instance two, I added:   <Engine name="Catalina" defaultHost="localhost" 
jvmRoute="instance2">
                                          

Reply via email to