Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

am a little confused when setting up 2 tomcat6 instances cluster in a clean ubuntu server 12.04. i didn't install default tomcat6 i used tomcat6-user's tomcat6-instance-create to create 2 instances. I'm using tutorial, unfortunately i haven't come across any tutorial using ubuntu with how apache2 is configured like ubuntu 12.o4. i mean by that , the structure of sites-available/enabled folder and mods-available/enabled that ubuntu uses.
i've installed libapache2-mod-jk and mods-enabled has jk.load,jk.conf.

server instance-1 uses port 8081 for http, port 8009 for ajp with jvmRoute="worker1" and instance-2 uses port 8082 for http, port 8010 for ajp with jvmRoute="worker2"


#setup instance-1

#setup instance-2

#setup the load-balancer

# Status worker for managing load balancer

here is the /etc/apache2/mods-available/jk.conf

<IfModule jk_module>
    JkWorkersFile /etc/apache2/

    JkLogFile /var/log/apache2/mod_jk.log

    JkLogLevel info

    JkShmFile /var/log/apache2/jk-runtime-status

    JkWatchdogInterval 60

    <Location /jk-status>
    # Inside Location we can omit the URL in JkMount
    JkMount jk-status
    Order deny,allow
    Deny from all
    Allow from
    <Location /jk-manager>
    # Inside Location we can omit the URL in JkMount
    JkMount jk-manager
    Order deny,allow
    Deny from all
    Allow from

    # Example for Mounting a context to the worker "balancer"
    # The URL syntax "a|b" instantiates two mounts at once,
    # the first one is "a", the second one is "ab".
    # JkMount /myapp|/* balancer

    # Example for UnMounting requests for all workers
    # using a simple URL pattern
    # Since: 1.2.26
    # JkUnMount /myapp/static/* *

    # Example for UnMounting requests for a named worker
    # JkUnMount /myapp/images/* balancer

    # Example for UnMounting requests using regexps
    # SetEnvIf REQUEST_URI "\.(htm|html|css|gif|jpg|js)$" no-jk

    # Example for setting a reply timeout depending on the requets URL
    # Since: 1.2.27
    # SetEnvIf Request_URI "/transactions/" JK_REPLY_TIMEOUT=600000

    # Example for disabling reply timeouts for certain request URLs
    # Since: 1.2.27
    # SetEnvIf Request_URI "/reports/" JK_REPLY_TIMEOUT=0

here is my virtualhost

<VirtualHost *:80>
  #DocumentRoot /var/www
  JkMount /* loadbalancer
  JkMount /status/* jk-status
  JkMount /jk-manager/* jk-status
  #Loglevel warn
  ErrorLog /var/log/apache2/go.myserver_error_log
  CustomLog /var/log/apache2/go.myserver_access_log combined

EDIT: after few hours of struggling the load balancing itself seems to work. just that i can't access the load balancer manager page via nor there are also this entries in the mod_jk.log file

[Mon May 06 13:34:48.633 2013] [9845:139723554592576] [info] init_jk::mod_jk.c (3252): mod_jk/1.2.32 () initialized
[Mon May 06 13:34:48.633 2013] [9845:139723554592576] [error] uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon May 06 13:34:48.633 2013] [9845:139723554592576] [error] uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker with name 'jk-status' in uri map p/var/log/apache2/mod_jk.log

Question 1 : what am i missing? why it doesn't work?

Question 2 : is the #DocumentRoot /var/www really necessary?

Question 3 : what is the difference between the JkMount in the IfModule of the jk.conf file and the JkMount from the virtualhost

Kindly help me set this up correctly. thanks

share|improve this question
Well, re: Question 2, Things following a # in Apache configuration files are comments (i.e. as far as Apache is concerned they don't exist). So no, anything following a # is not necessary unless it contributes in some way to your understanding of the contents of the file. – voretaq7 May 6 '13 at 17:49
@voretaq7 i commented it out myself because as far as am concerned it's useless in my case. if you check the link of the tutorial i was following DocumentRoot was uncommented. THanks – black sensei May 6 '13 at 17:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.