You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Madere, Colin" <co...@ieminc.com> on 2002/12/11 05:03:50 UTC

RE: JK - warning/question about naming workers (and auto-generati ng mod_jk.conf)

Well, it seems that:

site1 -> worker.ajp13:8009 -> tomcathost1
site2 -> worker.ajp13:8009 -> tomcathost2 (but mapped to same
docBase/appBase)

works with the examples hitting both for session data in different browsers
to be sure.  Did this by just adding the extra Host in Tomcat and the
Listener, then auto-generating mod_jk.conf with a single worker set up in
workers.properties and starting up Apache (after waiting the obligatory 10
seconds or so :] ).

So since it doesn't seem as though I need more workers I'm going to try this
out.  Is there necessarily a performance reason to go with more?  I didn't
get that impression and I think I've read just about all the JK docs out
there in about 5 locations (4 of which are on the apache.org tree).  Of
course, I did some skimming at times.

WARNING:
Note about auto-generated "mod_jk.conf" file.

It seems no matter what you name your workers, the auto-generated virtual
hosts are based _only_ on the <Host> tags in your server.xml for Tomcat and
the process _does not_ look at your workers.properties file.  Evidence to
suggest this is that the autogenerated file _always_ "JkMounts" to a worker
named "ajp13" even if you do not have one defined as such in
workers.properties.

If anyone has experienced different behavior, please speak up.  If this is
documented somewhere, please post a link!

Colin

> -----Original Message-----
> From:	Turner, John [SMTP:JTurner@AAS.com]
> Sent:	Tuesday, December 10, 2002 9:45 PM
> To:	'Tomcat Users List'
> Subject:	RE: JK - warning/question about naming workers
> 
> 
> Well, in the short term, I don't think there is anything preventing you
> from
> setting up:
> 
> site1 -> worker.site1:8009 -> tomcat1:8009 
> site2 -> worker.site2:8010 -> tomcat1:8010
> site3 -> worker.site3:8011 -> tomcat1:8011
> 
> That would simply require three CoyoteConnectors.  We use something
> similar
> on our Tomcat 3.x servers...every vhost has it's own connector and
> connector
> port, but that's using JServ.
> 
> Right now, my test box for 4.1.12 has:
> 
> site1 -> worker.site1 -> tomcat1:8009
> site2 -> worker.site2 -> tomcat1:8009
> 
> But again, I haven't beat up on that, so I can't say that it works in all
> cases.
> 
> John
> 
> 
> -----Original Message-----
> From: Madere, Colin [mailto:colin.madere@ieminc.com] 
> Sent: Tuesday, December 10, 2002 4:11 PM
> To: 'Tomcat Users List'
> Subject: RE: JK - warning/question about naming workers
> 
> Well it would make sense that all could use 8009 if they are different
> hosts
> on different IPs, but depending on how the port is used that may not work
> if
> you want to use a single Tomcat host for multiple Apache hosts.
> 
> That is my situation I'm trying to get working.
> 
> site1 -> worker.site1 -> tomcat1 (this works, obviously)
> site2 -> worker.site? -> tomcat1
> site3 -> worker.site? -> tomcat1
> 
> Any suggestions on this appreciated.  I don't want it to "just work", I
> want
> to be sure I know why it works and that it's not going to blow up when it
> goes to production.
> 
> Thanks for the super-fast feedback, John.
> 
> > -----Original Message-----
> > From:	Turner, John [SMTP:JTurner@AAS.com]
> > Sent:	Tuesday, December 10, 2002 2:21 PM
> > To:	'Tomcat Users List'
> > Subject:	RE: JK - warning/question about naming workers
> > 
> > 
> > Actually, I posted too soon.  After I thought about it, I realized that
> I
> > haven't really beat that test instance up any, I've been focusing on one
> > particular webapp and one particular client/URL.
> > 
> > I did end up having to add another entry to workers.properties for a
> > second
> > hostname, though as it stands now it looks like the various workers can
> > all
> > use port 8009.  I will have to investigate further.
> > 
> > I apologize for the previously posted misinformation that said one
> worker
> > definition could handle multiple vhosts.
> > 
> > John
> > 
> > > -----Original Message-----
> > > From: Turner, John [mailto:JTurner@AAS.com]
> > > Sent: Tuesday, December 10, 2002 2:53 PM
> > > To: 'Tomcat Users List'
> > > Subject: RE: JK - warning/question about naming workers
> > > 
> > > 
> > > 
> > > As far as I know, the "host" parameter in workers.properties 
> > > is the lcoation
> > > of the Tomcat server...it has nothing to do with the hostname 
> > > used in the
> > > URL.
> > > 
> > > If you had more than one Host in server.xml, you would put an 
> > > ApacheConfig
> > > Listener in there for each one.
> > > 
> > > I have this setup in my 4.1.12 test instance right now.  
> > > There are multiple
> > > Hosts in server.xml, each with one or more Contexts.  
> > > Workers.properties
> > > only has one worker defined, and the mod_jk.conf file generated by
> > > ApacheConfig has multiple Apache VirtualHosts defined.
> > > 
> > > HTH
> > > 
> > > John
> > > 
> > > > -----Original Message-----
> > > > From: Madere, Colin [mailto:colin.madere@ieminc.com]
> > > > Sent: Tuesday, December 10, 2002 2:47 PM
> > > > To: 'Tomcat Users List'
> > > > Subject: JK - warning/question about naming workers
> > > > 
> > > > 
> > > > I just fought with a problem for quite a while and thought 
> > > I'd share a
> > > > caution and ask a question.
> > > > 
> > > > The mod_jk.conf auto-generated by Tomcat assumes that your 
> > > > worker for the
> > > > /examples (and other default apps in Tomcat) is named 
> > > > "ajp13".  If you name
> > > > it anything else you'll get a 500 error since JK drops the 
> > > > request due to no
> > > > valid worker being found.  You MUST name a worker "ajp13" for 
> > > > those things
> > > > to work.
> > > > 
> > > > This brings up a question for me, how does Tomcat decide to 
> > > > map apps to
> > > > workers to auto-generate mod_jk.conf correctly?  Does it 
> > > > assume that you
> > > > will have all contexts that you want to map to a worker under 
> > > > a single host?
> > > > If so, doesn't this imply that you can't map multiple workers 
> > > > to the same
> > > > host (if Tomcat keys off the host)?  Am I off in left-field?  
> > > > In all the
> > > > documentation I've sought out did I miss the explanation of 
> > > > this somewhere?
> > > > 
> > > > Thanks again to those vigilant responders on this list!
> > > > 
> > > > Colin
> > > > 
> > > > 
> > > > --
> > > > To unsubscribe, e-mail:   
> > > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail: 
> > > > <ma...@jakarta.apache.org>
> > > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:   
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002
>  
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>