Compile Apache Tomcat mod_jk on CentOS

Installing mod_jk on Apache.


Software used in this article:

  1. CentOS 6.9
  2. Apache 2.2.15
  3. Tomcat Connectors 1.2.42


# yum install httpd-devel apr apr-devel apr-util apr-util-devel gcc make libtool autoconf

Get the latest source tarball:

# wget
# wget

Check the integrity of the file:

# sha1sum -c tomcat-connectors-1.2.42-src.tar.gz.sha1
tomcat-connectors-1.2.42-src.tar.gz: OK

Extract the archive:

# tar xf tomcat-connectors-1.2.42-src.tar.gz 
# cd tomcat-connectors-1.2.42-src/native/

Get the path for apxs:

# which apxs

Configure, compile and install:

# ./configure --with-apxs=/usr/sbin/apxs
# make
# libtool --finish /usr/lib64/httpd/modules
# make install


Open the file /etc/httpd/conf/ and add the following to reflect your application details:




Open the file /etc/httpd/conf/httpd.conf and add the following:

LoadModule jk_module modules/

JkWorkersFile "/etc/httpd/conf/"
JkLogFile     "/var/log/mod_jk.log"
JkLogLevel  info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%w %V %T"

Restart Apache. Check the log file mod_jk.log for any issues:

[Sun Dec 03 10:08:57 2017] [7005:140288381306848] [info] init_jk::mod_jk.c (3595): mod_jk/1.2.42 initialized

Related Articles

Configure IIS 8 and Tomcat Connector ISAPI Filter on Windows Server 2012


6 thoughts on “Compile Apache Tomcat mod_jk on CentOS

  1. Thank you for this useful cheatsheet. I’m not compiling mod_jk everyday so… this is a nice notes page.

  2. Also thank you for the Cheat Sheet, compiling from source to create an in-house RPM, you really helped make the first part easy! :)

  3. Thanks a lot – it still works.
    OS: Red Hat Enterprise Linux 8.5 (4.18.0-348.20.1.el8_5.ppc64le)
    SRC: tomcat-connectors-1.2.48-src.tar.gz

Leave a Reply

Your email address will not be published. Required fields are marked *