Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Installing Tomcat Connector (mod_jk)

I just upgraded to Leopard (not the server version, but this seemed the most logical place to post this), and I'm trying to get everything working that was working under Tiger. I have always kept the most recent version of mod_jk installed so I could serve jsp applications through Apache, and I've never had much trouble building and installing it on the PPC or Intel platform. (Well, the installer always put it in the wrong directory, but that was easy to fix.)

So last night I downloaded the latest version (1.2.26), built it, installed it, modified http.config to load it and ran the syntax check. apachectl said:

Cannot load /usr/libexec/apache2/mod_jk.so into server:
dlopen(/usr/libexec/apache2/mod_jk.so, 10): no suitable image found.
Did find:
/usr/libexec/apache2/mod_jk.so: mach-o, but wrong architecture


So I checked to see what the architecture of the file was. file said:

mod_jk.so: Mach-O bundle i386


So what's wrong with that? I checked a few other modules, and here's what file said about one of them:

mod_setenvif.so: Mach-O universal binary with 4 architectures
mod_setenvif.so (for architecture ppc7400): Mach-O bundle ppc
mod_setenvif.so (for architecture ppc64): Mach-O 64-bit bundle ppc64
mod_setenvif.so (for architecture i386): Mach-O bundle i386
mod_setenvif.so (for architecture x86_64): Mach-O 64-bit bundle x86_64


So I take it it's looking for x86_64? But why wouldn't the default architecture be the right one? I'm building it on the machine where I'm going to be using it. Not only that, but when I specify ./configure --with-apxs=/usr/sbin/apxs --with-arch-type x86_64 I get the same result.

Is there any way to build this thing, or can I get a binary somewhere?

MacBook Pro 17, Mac OS X (10.4.11), 4 GB RAM, 160 GB HD

Posted on May 20, 2008 8:03 PM

Reply
Question marked as Best reply

Posted on Jun 3, 2008 4:39 PM

Not sure if you got your answer yet, but after about 2 hours of digging I finally found a solution:

./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' --with-apxs=/usr/sbin/apxs

It works for me.

--adam
3 replies

Jul 31, 2008 5:13 PM in response to David Livesay

I found this in the BUILDING.txt file in the unzipped distribution.

Build for both Apache 1.3 and 2.0
---------------------------------

If you want to build mod_jk for Apache 1.3 and 2.0, you should :

use configure and indicate Apache 1.3 apxs location (--with-apxs)
use make
copy the mod_jk binary to the apache modules location

make clean (to remove all previously compiled modules)
use configure and indicate Apache 2.0 apxs location,
then make.

./configure --with-apxs=/usr/sbin/apxs
make
cp ./apache-1.3/mod_jk.so /usr/lib/apache
make clean
./configure --with-apxs=/usr/sbin/apxs2
make
cp ./apache-2.0/mod_jk.so /usr/lib/apache2

Installing Tomcat Connector (mod_jk)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.