> -----Original Message-----
> From: Rasputin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 17, 2002 5:41 AM
> To: Tomcat Users List
> Subject: Re: Apache-Tomcat HOWTO
> 
> 
> * Turner, John <[EMAIL PROTECTED]> [1201 14:01]:
> > 
> > Not sure what JK2 needs to work, I don't use it.  You 
> should be able to
> > build it from the same source package as JK.  I was able to 
> do so on my Red
> > Hat test box, but it took quite a bit of hacking around.
> 
> But you need a local install of Java; is that right?

Not sure.  I've used --with-java=${JAVA_HOME} when building the connectors,
and have also built them without it.

> Ok, thanks. I setup a Coyote/JK2 Connector on the tomcat side and used
> mod_jk to forward AJP13 requests to it. That seems to work 
> pretty well,
> although am I right in thinking a JkMount command can only 
> forward URIs
>  'as-is'?  i.e if I set 
> 
> JkMount /neotokyo/*   lb
> 
> then the request is going to be sent as a request to 
> /neotokyo/whatever.jsp
> - that is, as a request for whatever.jsp in the context neotokyo
> to the default Host element in my engine? I might have missed 
> something, but
> don't see how else it could work. The workers aren't URL aware, they
> just shovel requests into sockets.

Not the defaultHost, but whatever Apache VirtualHost has the JkMount.  If no
VirtualHost, than the value of Apache's global ServerName.  Tomcat will try
and match that value with a corresponding Host element and go from there.

> Doesn't this mean that if you mapped *.jsp, you'd need either 
> a ROOT context
> with directories mirroring Apaches tree, or a Context for 
> each top-level
> directory on the Apache side?

I don't think so.  At least, that's not how I have it setup.  I would just
map an Apache DocumentRoot to the same place as the Context and call it
good.  Then Apache can find http://some.server.com/images/some-static.gif
and Tomcat can find http://some.server.com/jsp/my.jsp.

Obviously, you'd want to setup Apache restrictions (deny, allow, etc) for
WEB-INF/*, etc.

> 
> And is the Host part of the protocol, so you can dedicate 
> virtual hosts to
> AJP clients? I got around this by having a Tomcat virtual 
> host with the
> DNS name of the Apache webserver, and setting it as the 
> Engines default host
>  - since no HTTP requests should come into tomcat  asking for 
> that host, it
> solves the problem but is pretty clanky.

As far as I know, there's no need to set defaultHost at all...if you needed
to do this, you could never have more than one virtual host, which is not
the case.  On one of my servers, I have defaultHost set to "localhost" and
several Host elements, each with a different value for the name parameter.
Those different name values match the ServerName value in the Apache
VirtualHost containers.

> 
> -- 
> Rasputin :: Jack of All Trades - Master of Nuns

John

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to