You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joseph Shraibman <jk...@selectacast.net> on 2004/03/18 07:49:39 UTC

how to use multiple jk2 connectors?

I have multiple ip based virtual hosts, so in tomcat I configured three 
seperate engines with connectors on different ports, and in the apache 
<VirtualHost> I JkMount the worker that I configured in 
worker.properties to connect on a specific port.  This works fine for 
mod_jk, but when I try mod_jk2 it insistes on using the default host of 
the engine that has the connector listening on port 8009.

This is how I configure jk2:
<Location "/*.jsp">
         JkUriSet worker ajp13:localhost:8019
</Location>

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


Re: how to use multiple jk2 connectors?

Posted by Adrian Lanning <al...@hotmail.com>.
Hi Joseph,

I had the same problem a while ago and never solved it. The root cause is
that for whatever reason the Location-JkUriSet combination acts globally to
the httpd.conf file rather than relative to the virtual host.  I wasn't sure
if the problem was with JkUriSet or with apache's Location directive.  It
sounds like it used to work for you with JkMount so the problem must be with
JkUriSet...

>> Side Note <<
List Users,
Am I correct in assuming the problem lies with JkUriSet?  Has anybody gotten
this to work?
>> <<

I had to work around this by explicitly defining mappings in
workers2.properties.  This, of course, blows the whole concept of mass
virtual hosting out of the water since you have to manually add domains to
the workers2 file...

Does jk work correctly in this sense, where mappings are relative to the
virtual host?  If so, i'm switching back...

Adrian Lanning


----- Original Message ----- 
From: "Joseph Shraibman" <jk...@selectacast.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, March 18, 2004 1:49 AM
Subject: how to use multiple jk2 connectors?


> I have multiple ip based virtual hosts, so in tomcat I configured three
> seperate engines with connectors on different ports, and in the apache
> <VirtualHost> I JkMount the worker that I configured in
> worker.properties to connect on a specific port.  This works fine for
> mod_jk, but when I try mod_jk2 it insistes on using the default host of
> the engine that has the connector listening on port 8009.
>
> This is how I configure jk2:
> <Location "/*.jsp">
>          JkUriSet worker ajp13:localhost:8019
> </Location>
>
> ---------------------------------------------------------------------
> 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


Re: how to use multiple jk2 connectors?

Posted by Joseph Shraibman <jk...@selectacast.net>.
Robert Hall wrote:
> Hi,
> 
> No offense intended, but I "have" to ask:
> 
> o Does your jk2.log give any hints as to what is going on?
> 
Nope.

> o Did you try stopping the TC instance that is listening on 8009
>   to see if one or more of the others would respond?
> 
No, when I have time I'll try that on my test machine


> o  Is it possible to make the URIs in <JkUriSet/>  more explicit -
>    like /app1/* and /app2/* ....  ?
> 
No, everything is at the top level

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


Re: how to use multiple jk2 connectors?

Posted by Robert Hall <rf...@berkeley.edu>.
Hi,

No offense intended, but I "have" to ask:

o Does your jk2.log give any hints as to what is going on?

o Did you try stopping the TC instance that is listening on 8009
   to see if one or more of the others would respond?

o  Is it possible to make the URIs in <JkUriSet/>  more explicit -
    like /app1/* and /app2/* ....  ?

Robert

Joseph Shraibman wrote:

> Robert Hall wrote:
>
>> Hi,
>>
>> Actually, I'm leaning towards a "bug" in mod_jk2 since a change in
>> workers2.properties resulted in everything (so far) working.  The only
>> extra detail I had to add was explicit reference to index.jsp for both
>> app's.
>>
>> Did you have a chance to try the config change I suggested?
>>
> That wouldn't work for me, since I have ip based virtual hosts.
>
> ---------------------------------------------------------------------
> 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


Re: how to use multiple jk2 connectors?

Posted by Joseph Shraibman <jk...@selectacast.net>.
Robert Hall wrote:
> Hi,
> 
> Actually, I'm leaning towards a "bug" in mod_jk2 since a change in
> workers2.properties resulted in everything (so far) working.  The only
> extra detail I had to add was explicit reference to index.jsp for both
> app's.
> 
> Did you have a chance to try the config change I suggested?
> 
That wouldn't work for me, since I have ip based virtual hosts.

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


Re: how to use multiple jk2 connectors?

Posted by Robert Hall <rf...@berkeley.edu>.
Hi,

Actually, I'm leaning towards a "bug" in mod_jk2 since a change in
workers2.properties resulted in everything (so far) working.  The only
extra detail I had to add was explicit reference to index.jsp for both
app's.

Did you have a chance to try the config change I suggested?

Robert

Joseph Shraibman wrote:

> Robert Hall wrote:
>
>> Joseph,
>>
>> We're using Apache 1.3.27 on solaris with mod_jk2 to connect to two 
>> JBoss/Tomcat instances
>> listening on separate ports.  I experienced the same thing you 
>> described, all requests going to
>> one of the jk2 ports.
>>
>> However, if I shutdown the JBoss/Tomcat instance that was getting all 
>> of requests, then the
>> other instance would start gettng the traffic.  After restarting the 
>> "primary" instance I examined
>> jk2.log.  It looked like the requests were heading to the correct 
>> server, but then would be "redirected"
>> to the primary.
>>
> So the bug is in tomcat somewhere, not in mod_jk2?
>
> ---------------------------------------------------------------------
> 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


Re: how to use multiple jk2 connectors?

Posted by Joseph Shraibman <jk...@selectacast.net>.
Robert Hall wrote:
> Joseph,
> 
> We're using Apache 1.3.27 on solaris with mod_jk2 to connect to two 
> JBoss/Tomcat instances
> listening on separate ports.  I experienced the same thing you 
> described, all requests going to
> one of the jk2 ports.
> 
> However, if I shutdown the JBoss/Tomcat instance that was getting all of 
> requests, then the
> other instance would start gettng the traffic.  After restarting the 
> "primary" instance I examined
> jk2.log.  It looked like the requests were heading to the correct 
> server, but then would be "redirected"
> to the primary.
> 
So the bug is in tomcat somewhere, not in mod_jk2?

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


Re: how to use multiple jk2 connectors?

Posted by Robert Hall <rf...@berkeley.edu>.
Joseph,

We're using Apache 1.3.27 on solaris with mod_jk2 to connect to two 
JBoss/Tomcat instances
listening on separate ports.  I experienced the same thing you 
described, all requests going to
one of the jk2 ports.

However, if I shutdown the JBoss/Tomcat instance that was getting all of 
requests, then the
other instance would start gettng the traffic.  After restarting the 
"primary" instance I examined
jk2.log.  It looked like the requests were heading to the correct 
server, but then would be "redirected"
to the primary.

I'm using (or misusing?) the load balance feature to accomplish the 
splitting instead of the <VirtualHost>
or <Location>.

Not sure why it was necessary, but I had to add explicit entries for 
index.jsp for both apps for it
it to function correctly.  Other URIs were not confused.  From 
workers2.properties:

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket:8009
debug=7
tomcatId=localhost:8009
group=app1
disabled=0

[channel.socket:localhost:8709]
info=Ajp13 forwarding over socket:8709
debug=7
tomcatId=localhost:8709
group=app2
disabled=0

#
# app1-test servlet/jsp uris
# static content served
# by apache http
#
[uri:/app1-test]
debug=0
group=app1
[uri:/app1-test/]
debug=0
group=app1
[uri:/app1-test/index.jsp]
debug=0
group=app1
[uri:/app1-test/*.jsp]
debug=0
group=app1
[uri:/app1-test/admin/*.jsp]

#
# app2-test servlet/jsp uris
#
[uri:/app2-test]
debug=0
group=app2
[uri:/app2-test/]
debug=0
group=app2
[uri:/app2-test/index.jsp]
debug=0
group=app2
[uri:/app2-test/*.jsp]
debug=0
group=app2
[uri:/app2-test/login/*]
debug=0
group=app2

HTH,
Robert

Joseph Shraibman wrote:

> I have multiple ip based virtual hosts, so in tomcat I configured 
> three seperate engines with connectors on different ports, and in the 
> apache <VirtualHost> I JkMount the worker that I configured in 
> worker.properties to connect on a specific port.  This works fine for 
> mod_jk, but when I try mod_jk2 it insistes on using the default host 
> of the engine that has the connector listening on port 8009.
>
> This is how I configure jk2:
> <Location "/*.jsp">
>         JkUriSet worker ajp13:localhost:8019
> </Location>
>
> ---------------------------------------------------------------------
> 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