Installing mod_jk in Apache 2.2 running on Debian

Assumptions:

  • You have a working fresh installation of Apache2
  • You have a working installation of Java
  • You have a working installation of Tomcat

Install mod_jk from repositories:

sudo apt-get install libapache2-mod-jk

Configure worker.properties:

Open file:

/etc/libapache2-mod-jk/workers.properties

In this file you mainly have to modify the following properties and make them point to your local configurations:

workers.tomcat_home

workers.java_home

Configure apache2

Create the file jk.conf with the following content:

<IfModule mod_jk.c>
  JkWorkersFile /etc/libapache2-mod-jk/workers.properties
  JkLogFile /var/log/apache2/mod_jk.log
  JkLogLevel info
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  JkRequestLogFormat "%w %V %T"
  # Mount your applications
  JkMount /_path_to_your_webapp ajp13_worker
  JkShmFile /var/log/apache2/jk.shm
</IfModule>

and place in folder:

/etc/apache2/mods-available

add a symbolic link to this file in:

/etc/apache2/mods-enabled

Finally, restart apache