Tomcat – No mod_jk.so generated when compiling tomcat connector

ajpapache-2.2tomcat

When I try to compile the tomcat connector from source, everything appears fine except that no mod_jk.so file gets created.

Software versions:
RHEL6 x86_64
httpd-2.4.3
tomcat-connector 1.2.37

Commands:


cd native
./configure --with-apxs=/usr/local/apache2/bin/apxs
make
cd apache-2.0
ls

The only warning message during the make is:
Warning! dlname not found in /usr/local/tomcat-connectors-1.2.37-src/native/apache-2.0/mod_jk.la.

Does anyone have any suggestions on how to get the mod_jk.so file to be generated?

Best Answer

I eventually got this to work. It turns out that I had bigger problems than just the tomcat connector.

First, there are several things I needed to do to compile apache with 64 bit Linux. I was getting build errors such as:

relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC 

To fix that, OpenSSL had to have a special configure option:

./configure -fPIC

So I recompiled OpenSSL, which allowed Apache to compile the ssl module correctly. Then I got another error during the apache make install:

libtool: install: error: relink `libaprutil-1.la' with the above command before installing it

To fix this, the APR classes needed a special configuration option during their compilation:

CC="gcc -m64" ./configure --prefix=/usr/local/apr
CC="gcc -m64" ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

Compiling these separately meant that I needed to use the --with-apr option instead of --with-included-apr in the Apache build:

./configure ... --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

I also had been using a strange config option during the Apache configuration:

--with-apxs2=...

which should have been:

--with-apxs=...

After getting all of those things straightened out and recompiling apache, I tried again with the tomcat connector build. The mod_jk.so file then generated correctly.