This post briefly explains how to compile mod_jk on the Centos6.3 OS.

Mod_jk is an Apache module that is used to connect Tomcat to Apache Http server or other web servers.

System Setup
OS: Centos 6.3
Webserver: Apache Http Server 2.2.15
Application Server:  Tomcat 7.0.27
Application: Liferay Enterprise  6.1.20


Download the source for mod_jk at

Extract the .tar.gz archive. The following will assume that the archive was downloaded to the /home/liferay/liferay-install/ directory:

tar -zxvf /home/liferay/liferay-install/tomcat-connectors-1.2.37-src.tar.gz

Change to the native folder within the newly created tomcat-connectors-1.2.37-src folder

Download the prerequisite libraries to compile the source code

sudo yum install httpd-devel
sudo yum install gcc gcc-c++
sudo yum install make

Change permissions on the configure file, if necessary

chmod u+x configure

Run configure with the appropriate options

./configure --with-apxs=/usr/sbin/apxs

Change permissions of the file (within the /home/liferay/liferay-install/tomcat-connectors-1.2.37-src/native/scripts/build/directory), if necessary.

 cd scripts/build
chmod u+x

In the native directory, run the make command


The file is now compiled and called  It is located within the /home/liferay/liferay-install/tomcat-connectors-1.2.37-src/native/apache-2.0 directory

Copy the compiled module to the httpd/modules directory and configure Apache to include it.

Credit to Jack Chung for the bulk of the article.

Share This