Chat with us, powered by LiveChat
Installing and configuring mod_jk

Installing and configuring mod_jk

In order to make the connection between Tomcat and Apache, we will need to download and install mod_jk connector. You will find that the Apache documentation recommends that you install the packaged version of mod_jk if it is available for your particular Linux distribution.

Many outdated resources recommend installing the mod_jk2 connector, but we have found that it has been deprecated and although mod_jk was developed before mod_jk2, it is still fully supported and is very stable.

1. Download the current source from the Apache archives:

Download the jakarta-tomcat-connectors-1.2.15-src.tar.gz file to your /usr/src/ directory.

2. Change to the /usr/src directory.

#cd /usr/src

3. Next, extract the contents to create the /usr/src/jakarta-tomcat-connectors-1.2.15-src directory.

#unp jakarta-tomcat-connectors-1.2.15-src.tar.gz

4. Change to the /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native directory.

#cd jakarta-tomcat-connectors-1.2.15-src/jk/native

5. Now you are ready to create the custom configure file for your system. Execute the following:


This will create a configure file in the /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native directory.

6. Execute the following command in order to configure mod_jk for your system.
Important note: You will need to have apxs2 (APache eXtension tool) installed and configured with Apache. If you do not have it, as was my case, you can download and install the apache2-threaded-dev package (which replaced the former apache-dev package) from At the time of this writing, the Debian package archive at was down and they referred me to their temporary site until they resolved their issues I found the apache2-threaded-dev package and was able to install it successfully.

Be sure to include the correct location apxs2 on your system in the path of the command.

#./configure –with-apxs=/usr/bin/apxs2

7. Now build the mod_jk with the following:


8. Finally, if you were successful with the previous commands, copy the newly created to your Apache2 modules directory. My modules were located at /usr/lib/apache2/modules.

#cd apache-2.0

#cp /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native/apache-2.0/ /usr/lib/apache2/modules

You now are ready to move to the next stage which is to begin configuring Apache and Tomcat. You can find more information about the mod_jk connector here


Leave your comment

Pin It on Pinterest

Share This