tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From VEGH Karoly <>
Subject usage of JkWorkersFile and JkLogFile in apache config.
Date Sat, 01 May 2004 17:33:38 GMT

Hi all,

I am trying to integrate two Tomcat instances with one apache with 
mod_jk2 on a linux box.
Well, I have an idea how to do this, but it the 'official' way
is others, do not hesitate to let me know it.

With a single tomcat instance everything works fine, e.g. the /admin 
and the /manager and the /examples apps.

What I though of, is: two VirtualHost entries in apache, both 
using mod_jk2 to connect to two different tomcat-instances.

The challange at it is: the location of the file is
hardcoded in the mod_jk2:

bilbo:~# strings /usr/lib/apache2/modules/ | grep workers2.proper

because of this I of course have an /etc/apache2/conf/

well, i thought no problem, i could use the JkWorkersFile directive in the 
VirtualHost section, like this:


NameVirtualHost tomcat:80
<VirtualHost tomcat:80>
        ServerName tomcat
        DocumentRoot /var/www/

[...apache directives snipped ...]

<IfModule mod_jk.c>
        JkWorkersFile /etc/apache2/conf/
        JkWorkersFile /etc/apache2/conf/
        JkMount /examples/* ajp13
        JkMount /examples/ ajp13
        JkLogFile /var/log/apache2/tomcat-mod_jk.log

    <Location "/examples/*">
            JkUriSet worker ajp13:localhost:8009 
    <Location "/examples/">
            JkUriSet worker ajp13:localhost:8009 


        LogLevel warn
        ErrorLog /var/log/apache2/tomcat-error.log
        CustomLog /var/log/apache2/tomcat-access.log combined


my other VirtualHost entry looks like this one, just I used everywhere
"tomcat2" instead od "tomcat".

...and in the /etc/apache2/conf/ file and in the 
/etc/apache2/conf/ files I thought I could define
different channel sockets with the same uri's so that from the 
tomcat VirtualHost the /examples/ uri through channel.socket would run on 
port 8009 (on the first tomcat instance), and from the tomcat2 VirtualHost 
the /examples/ uri through the channel socket would run on port 8109
(to the second tomcat instance).

Well, the VirtualHost directives work fine, since the errormessages about 
the virtualhost come to the ErrorLog defined in the VirtualHost:

bilbo:/var/log/apache2# tail -1 tomcat-error.log 
[Tue May 18 18:29:42 2004] [error] [client] File does not exist: /var/www/examples

But the JkWorkersFile directives in the VirtualHost seem to be ignored somehow,
since I have defined the /examples/ uri in my file, 
but still I don't get any connection between the VIrtualHost and the first tomcat
the JkLogFile directive doesnt work either.

how to override the location and the directives in it?

the relevant parts of my file:




info=Maps the requests. Options: debug

# Alternate file logger


info=Ajp13 forwarding over socket


info=Status worker, displays runtime informations


info=Display status information and checks the config file for changes.

info=Example webapp in the default context.

info=Extension mapping

info=Map the whole webapp


What did i do wrong?
with the port give in the URL everything works fine.
any help is appreciated, and ofcourse I am ready to give more informaiton,
if necessary.

a quick and dirty hack would be to use more files with different path hardcoded in them, but Im not sure what the apache
would say if I would want to load  a module two times with different names.

oh yes: 

tomcat 4.1.30
apache 2.0.49

mod_jk version:

bilbo:/var/log/apache2# lynx -dump localhost  |grep mod_jk
    Apache/2.0.49 (Debian GNU/Linux) mod_jk2/2.0.2 Server at localhost



Végh Károly -  System Engineer - UTA - TIS.SAS.BSS
"There are two major products that come out of Berkeley: LSD and UNIX.
 We don't believe this to be a coincidence." 
 				- Jeremy S. Anderson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message