> From: [email protected]
> To: [email protected]
> Subject: RE: Multiple tomcat Instances on Same Server and One Apache Instance
> Date: Mon, 14 May 2012 21:54:31 -0400
>
>
>
>
> > Date: Tue, 15 May 2012 01:18:06 +0200
> > From: [email protected]
> > To: [email protected]
> > Subject: Re: Multiple tomcat Instances on Same Server and One Apache
> > Instance
> >
> > Apologies, I probably confused you too. See below.
> >
> > Vickie Troy-McKoy wrote:
> > ...
> >
> > >>>>>>
> > >>>>>> 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
> >
> > That is probably not what you want (and the one contradicts the other).
> > You should probably have instead :
> >
> > # forward "/abc*" requests to Tomcat "instance1" only
> > JkMount /abc instance1
> > JkMount /abc* instance1
> >
> > # forward "/xyz*" requests to Tomcat "instance2" only
> > JkMount /xyz instance2
> > JkMount /xyz* instance2
> >
> > # forward "/tsa*" requests to either Tomcat, as selected by the balancer
> > worker
> > JkMount /tsa balance1
> > JkMount /tsa* balance1
> >
> > Note: if you really want to forward everything to Tomcat, and it doesn't
> > matter which
> > Tomcat, and you want to let the balancer decide when to forward any request
> > to either
> > Tomcat-1 or Tomcat-2, then just use the single line :
> > JkMount /* balance1
> >
> >
> >
> >
> > >
> > > In workers.properties, added the load balancer information; it reflects
> > > the following:
> > >
> > You seem to be missing :
> >
> > workers.list=instance1,instance2,balance1
> >
> > (as per Pid's earlier instructions, not as per my erroneous comment)
> >
> > > worker.balance1.type=lb
> > > worker.balance1.balance_workers=instance1, instance2 <-- mod_jk may not
> > > like the space after comma
> > > #
> > > 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">
> > >
> >
> >
> > ---------------------------------------------------------------------
>
> Thanks again. I'll try this tomorrow. I just want to forward based on the
> port that the Tomcat instance is running on. The 2 tomcat instances running
> on the same server is really the same application--but different versions.
> And, I thought that I could use the existing Apache instance to forward
> requests to the new version of the app running on tomcat as well. But, if I
> want (e.g. the tsademo app) the tomcat instance running on port 8009; and
> tsademo is being forwarded to both ports--how can I be sure that I would get
> the tsademo running on port 8009 and not the one running on 7009? I tried
> using the Virtual host in Apache; but, ran into issues with that. Or, should
> I just go ahead and create an entirely new apache instance for the new tomcat
> instance?
>
> Regards,
>
>
>
Thank you Andre for your help. After I configured it as you specified, the
behavior was the same as before I inquired on this forum. To avoid additonal
delay, I just went ahead and created another apache2 instance and kept both
configurations separate. Thanks again for your suggestions. Regards...