Tomcat’s Apache2 Connector

Installing the Tomcat connector

A tomcat


First off, we get the source code for the latest connector, mod_jk.

cd /usr/local/src   
gzip -d tomcat-connectors-1.2.42-src.tar.gz 
tar xvf tomcat-connectors-1.2.42-src.tar 

I wish I had saved a day by ignoring the “How To” on creating and adding a module to apache2…

This is the way to go:              “Getting mod_jk linked statically with Apache”

As noted there, we do indeed need libtool 1.5.2, automake 1.10 and autoconf 2.59 or newer.

apt-get install automake
apt-get install autoconf
apt-get install libtool

And while there, for good measure or perhaps superstitional reasons, apt-get install httpd-devel

Also, for some forgotten and otherwise unknown reason, libtool was not in an expected path for me, so I created a link to it by doing this and kept going:

cd /usr/local/bin
ln -s /usr/local/src/httpd-2.4.25/srclib/apr/libtool libtool

Then all seemed to work:

cd /usr/local/src/tomcat-connectors-1.2.42-src/native
./configure --with-apache=/usr/local/src/httpd-2.4.25
make install   ( this “install” copies mod_jk files to the apache src tree in httpd-2.4.25 )

Installation instructions for my apache2 compile  is here:

Now we can compile apache2 with the included code for mod_jk.

cd /usr/src/httpd-2.4.25
make clean

./configure --enable-ssl                                             
     --with-mpm=prefork                ( needed for php to work )
make install

/usr/local/apache2/bin/httpd -l    Shows that mod_jk.c is in fact now compiled in.

As I left out where the log files need to be created ( the default goes in /usr/local ), important to edit the apche2 configuation file ( /usr/local/apche/conf/httpd.conf ) so others can find them, ie applications like awstats and system utilities like cron, which expect to find them under /var/log.

LogFile=/var/log/apache2/access.log    ( and any other specific logs for other domains )

© 2017, James Harry Burton. All rights reserved.