You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Rosenberry <er...@rosenberry.org> on 2001/08/31 20:16:24 UTC

mod_jk Virtual Host Problems

I am trying to get apache setup with four virtual hosts that send requests
for .jsp files to four separate tomcat workers.  I am using mod_jk to do
this with the commands below in my httpd.conf file.  My problem is that
mod_jk seems to only pay attention to the first set of JKMount commands.  So
the end result is that ALL my virtual hosts get sent to the worker called
"service".

I am using Tomcat 3.2.3 and the mod_jk from the following URL:
http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.3/bin/win32/i38
6/

Any help would be greatly appreciated!  I KNOW this can be done as the
Tomcat documentation tells me how to do it with mod_jserv.

<VirtualHost *>
    ServerAdmin admin@mydomain.com
    DocumentRoot d:/webdocs/service
    ServerName service.int.mydomain.com
    ErrorLog d:/logs/service/apache/error.log
    CustomLog d:/logs/service/apache/access.log common
    JkMount /*.jsp service
    JkMount /servlet/* service
</VirtualHost>

<VirtualHost *>
    ServerAdmin admin@mydomain.com
    DocumentRoot d:/webdocs/demo
    ServerName demo.int.mydomain.com
    ErrorLog d:/logs/demo/apache/error.log
    CustomLog d:/logs/demo/apache/access.log common
    JkMount /*.jsp demo
    JkMount /servlet/* demo
</VirtualHost>

<VirtualHost *>
    ServerAdmin admin@mydomain.com
    DocumentRoot d:/webdocs/store
    ServerName store.int.mydomain.com
    ErrorLog d:/logs/store/apache/error.log
    CustomLog d:/logs/store/apache/access.log common
    JkMount /*.jsp store
    JkMount /servlet/* store
</VirtualHost>

<VirtualHost *>
    ServerAdmin admin@mydomain.com
    DocumentRoot d:/webdocs/payment
    ServerName payment.int.mydomain.com
    ErrorLog d:/logs/payment/apache/error.log
    CustomLog d:/logs/payment/apache/access.log common
    JkMount /*.jsp payment
    JkMount /servlet/* payment
</VirtualHost>

-Eric



Re: mod_jk Virtual Host Problems

Posted by Jason Koeninger <jk...@jjcc.com>.
I may be mistaken, but this is an Apache problem, isn't it?

To do name based virtual hosts in Apache, you have to 
have a NamedVirtualHost (not sure if that's exactly the right 
directive) entry that gives the IP where you'll put  the hosts. 
Then, the VirtualHost entries have to use that same IP 
address in their declaration.  I'm not sure you can get away 
with the asterick like that, but I could be wrong.  

Given that you're only getting the response from the first one, I'm 
going to guess that Apache's not getting to the others.  Try some 
html files in your document roots to see if it's Apache or if it's 
mod_jk.

Best Regards,

Jason Koeninger
J&J Computer Consulting
http://www.jjcc.com

On Fri, 31 Aug 2001 11:16:24 -0700, Eric Rosenberry wrote:

>I am trying to get apache setup with four virtual hosts that send requests
>for .jsp files to four separate tomcat workers.  I am using mod_jk to do
>this with the commands below in my httpd.conf file.  My problem is that
>mod_jk seems to only pay attention to the first set of JKMount commands.  So
>the end result is that ALL my virtual hosts get sent to the worker called
>"service".
>
>I am using Tomcat 3.2.3 and the mod_jk from the following URL:
>http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.3/bin/win32/i38
>6/
>
>Any help would be greatly appreciated!  I KNOW this can be done as the
>Tomcat documentation tells me how to do it with mod_jserv.
>
><VirtualHost *>
>    ServerAdmin admin@mydomain.com
>    DocumentRoot d:/webdocs/service
>    ServerName service.int.mydomain.com
>    ErrorLog d:/logs/service/apache/error.log
>    CustomLog d:/logs/service/apache/access.log common
>    JkMount /*.jsp service
>    JkMount /servlet/* service
></VirtualHost>
>
><VirtualHost *>
>    ServerAdmin admin@mydomain.com
>    DocumentRoot d:/webdocs/demo
>    ServerName demo.int.mydomain.com
>    ErrorLog d:/logs/demo/apache/error.log
>    CustomLog d:/logs/demo/apache/access.log common
>    JkMount /*.jsp demo
>    JkMount /servlet/* demo
></VirtualHost>
>
><VirtualHost *>
>    ServerAdmin admin@mydomain.com
>    DocumentRoot d:/webdocs/store
>    ServerName store.int.mydomain.com
>    ErrorLog d:/logs/store/apache/error.log
>    CustomLog d:/logs/store/apache/access.log common
>    JkMount /*.jsp store
>    JkMount /servlet/* store
></VirtualHost>
>
><VirtualHost *>
>    ServerAdmin admin@mydomain.com
>    DocumentRoot d:/webdocs/payment
>    ServerName payment.int.mydomain.com
>    ErrorLog d:/logs/payment/apache/error.log
>    CustomLog d:/logs/payment/apache/access.log common
>    JkMount /*.jsp payment
>    JkMount /servlet/* payment
></VirtualHost>
>
>-Eric
>
>