Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What version of tomcat are you compiling for? IIRC, mod_jk.so was for early/earlier versions of tomcat and has been replaced. –  jim_m_somewhere Dec 11 '12 at 17:46
    
compiling for tomcat 7.0.33. –  user1171848 Dec 11 '12 at 18:04

2 Answers 2

The system info

# uname -r
2.6.32-358.14.1.el6.x86_64

# cat /etc/redhat-release
CentOS release 6.4 (Final)

# rpm -qa | grep httpd
httpd-devel-2.2.15-28.el6.centos.x86_64
httpd-2.2.15-28.el6.centos.x86_64
httpd-tools-2.2.15-28.el6.centos.x86_64

I will suggest to build from source only module himself

# cd /root/
# wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz

# tar -xzf tomcat-connectors-1.2.37-src.tar.gz
# cd tomcat-connectors-1.2.37-src/native/
# ./configure --prefix=/opt/ --with-apxs=/usr/sbin/apxs
# make
# file apache-2.0/mod_jk.so
apache-2.0/mod_jk.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped

# cp apache-2.0/mod_jk.so /usr/lib64/httpd/modules/
# echo "LoadModule jk_module modules/mod_jk.so" > /etc/httpd/conf.d/mod_jk.conf

# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

# apachectl -t -D DUMP_MODULES | grep jk
Syntax OK
 jk_module (shared)

So there is no need to install apache/openssl/apr/apr-util from source. If you want to upgrade the packages - it would be the hell

share|improve this answer
    
I agree that if you can install Apache via RPM, then the process is a whole lot easier. We chose to install Apache from source for a few reasons: 1) we had done it that way in the past, 2) we had better control of included modules, and 3) we could get the latest version. We may reconsider our approach in the future. –  user1171848 Aug 7 '13 at 19:25
up vote 0 down vote accepted

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.

share|improve this answer
    
It's a terrible solution. And why do you need to use apache-2.4.3? tomcat-connector 1.2.37 build without any problem with httpd-2.2.15. Or do you need some specific features from 2.4.x? –  ALex_hha Aug 6 '13 at 19:39
    
My 'terrible' solution is what got mod_jk to compile. I posted it here in hopes that it might help someone having the same problems. The solution has nothing to do with Apache 2.4; I had the same problems with Apache 2.2. If you have a better solution, feel free to post it as an answer. –  user1171848 Aug 7 '13 at 15:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.