You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Turner <to...@johnturner.com> on 2003/04/01 00:02:19 UTC

Re: Help with one Apache, mod_jk, two Tomcats, no load balancing

Yes.

The logs are showing strange (to me) behavior.  Where it says "tomcat1" 
below, it should be "tomcat2".  I'm puzzled by the first line.  Anyone know 
what "agsn", "hostn", and "shostn" equal?  I will troll the source code 
tonight, but does anyone know that that means?  "shostn" is incorrect...it 
should be "host2" to match the others.

[Mon Mar 31 16:48:59 2003]  [mod_jk.c (471)]: agsp=80 agsn=host2.com 
hostn=host2.com shostn=host1.com cbsport=0 sport=0
[Mon Mar 31 16:48:59 2003]  [jk_ajp_common.c (1391)]: Into 
jk_worker_t::get_endpoint
...
...
[Mon Mar 31 16:48:59 2003]  [jk_uri_worker_map.c (460)]: Into 
jk_uri_worker_map_t::map_uri_to_worker
[Mon Mar 31 16:48:59 2003]  [jk_uri_worker_map.c (477)]: Attempting to map 
URI '/images/A2_incent.jpg'
[Mon Mar 31 16:48:59 2003]  [jk_uri_worker_map.c (502)]: 
jk_uri_worker_map_t::map_uri_to_worker, Found a context match tomcat1 -> /
[Mon Mar 31 16:48:59 2003]  [mod_jk.c (1277)]: Into handler r->proxyreq=0 
r->handler=jakarta-servlet r->notes=1578240 worker=tomcat1
[Mon Mar 31 16:48:59 2003]  [jk_worker.c (132)]: Into 
wc_get_worker_for_name tomcat1
[Mon Mar 31 16:48:59 2003]  [jk_worker.c (136)]: wc_get_worker_for_name, 
done  found a worker

On Mon, 31 Mar 2003 16:35:06 -0500, Tim Funk <fu...@joedog.org> wrote:

> Do you have JkWorkersFile and NameVirtualHost defined before the virtual 
> host defs? (1.3 syntax follows ... )
>
> For example:
> JkWorkersFile conf/workers.properties
> NameVirtualHost 192.168.0.1
>
> <VirtualHost more>
> DocumentRoot "/home/more/htdocs"
> JkMount /*.do cowbell
> </VirtualHost>
> ...
>
> When in doubt, turn up the debugger.
> JkLogLevel debug
>
> -Tim
>
> John Turner wrote:
>> Hi -
>>
>> I have been tweaking on this all day, with no luck.  I am hoping someone
>> here can help me out.
>>
>> Solaris 8
>> Apache 2.0.44
>> Mod_jk
>> Tomcat 4.1.18
>>
>> I would like to assign a Tomcat instance to each Apache virtual host.
>>
>> http://www.host1.com -> Tomcat 1
>> http://www.host2.com -> Tomcat 2
>>
>> I have two Tomcat instances setup and working great using CATALINA_HOME
>> and CATALINA_BASE.  I have verified this with:
>>
>> http://www.host1.com:8080 -> Tomcat 1 (works great!)
>> http://www.host2.com:8081 -> Tomcat 2 (works great!)
>>
>> So, I proceeded to setup my Apache virtual hosts with mod_jk, and 
>> thought
>> everything was fine until I realized that both Apache hosts were using 
>> the
>> same Tomcat instance.  It's the same webapp, just distinct hostnames.  I
>> want separate Tomcat instances so that I can administer (stop/start, 
>> etc)
>> them without effecting the other.
>>
>> I believe the problem is workers.properties.  I setup two workers, 
>> tomcat1
>> and tomcat2, but no matter what, only tomcat1 gets used.  My
>> workers.properties file looks like this:
>>
>> worker.list=tomcat1, tomcat2
>> worker.tomcat1.port=8009
>> worker.tomcat1.host=127.0.0.1
>> worker.tomcat1.type=ajp13
>>
>> worker.tomcat2.port=9009
>> worker.tomcat2.host=127.0.0.1
>> worker.tomcat2.type=ajp13
>>
>> I've tried various iterations of workers.properties, including removing
>> worker.list, using "localhost" instead of 127.0.0.1, using the FQDN
>> instead of "localhost", using two workers.properties files instead of 
>> one,
>> etc.  The only results so far are either a 500 Internal Server Error or
>> both Apache virtual hosts end up using the same Tomcat instance.
>>
>> The JkMounts are appropriate:
>>
>> VirtualHost host1
>> ....
>> JkMount /*.do tomcat1
>> ....
>> /VirtualHost
>>
>> VirtualHost host2
>> ....
>> JkMount /*.do tomcat2
>> ....
>> /VirtualHost
>>
>> Can anyone help me out?  What am I missing?  This must be possible...I
>> have 22 Tomcat 3.x instances operating behind one Apache with 22 virtual
>> hosts, but that is using mod_jserv.  A version of the same configuration
>> but with mod_jk instead has me totally stumped.
>>
>> Do I need to setup load-balancing but somehow restrict one worker to 
>> each
>> Tomcat instance?
>>
>> Thanks in advance for any help.
>>
>> John
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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