Apache 2.4 Tomcat7 and mod_jk

Ilkar picture Ilkar · Jun 13, 2014 · Viewed 21k times · Source

I want to connect apache2.4 with tomcat7

My configuration is:

workers.properties

    workers.tomcat_home=/var/lib/tomcat7
workers.java_home=/usr/lib/jvm/java-7-oracle
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=domain.com
worker.worker1.port=8009

in jk.conf:

    JkWorkersFile /etc/apache2/workers.properties
JkLogStampFormat "[%b %d %Y - %H:%M:%S] "
JkRequestLogFormat "%w %V %T"
#JkAutoAlias /var/lib/tomcat7/webapps
#JkMountCopy All
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkMount /ROOT/ worker1
JkMount /ROOT/* worker1

When i resterting apache i have an error:

    [Jun 13 2014 - 11:32:50] [23256:140183177717632] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Jun 13 2014 - 11:32:50] [23256:140183177717632] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Jun 13 2014 - 11:32:50] [23256:140183177717632] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
[Jun 13 2014 - 11:32:50] [23257:140183177717632] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Jun 13 2014 - 11:32:50] [23257:140183177717632] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Jun 13 2014 - 11:32:50] [23257:140183177717632] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.

Do you know what is wrong ?

I cannot open application, i have empty page.

Answer

Santosh picture Santosh · Jul 10, 2014

You can ignore those errors referencing 'jk-manager' and 'jk-status' unless you want to enable management of the mod. You need to move the JK mount directive in to the VirtualHost section of your website. You can add the following to /etc/apache2/sites-available/default

<VirtualHost *:80> ... # Send everything for /* to worker1 JkMount /* worker1 ... </VirtualHost>