Building mod_jk for Apache 2.2 on Leopard

Well, I did it again but it took some figuring out. I suppose it is not very common to run Tomcat via mod_jk on Mac OS X 10.5.

Thu 13 Dec 2007 / André / 3 comments

You will need to have Xcode 3.0 installed for the right compiler, Xcode 2.5 may suffice but I haven't tested it.

In short

Download the mod_jk source distribution from Apache's website (at time of writing version 1.2.25): http://tomcat.apache.org/connectors-doc/index.html
Unpack the archive and open Terminal. Enter the directory you just unpacked, then enter the following commands. We will generally follow the with the source code provided instructions in 'BUILD.txt'.
Change to the directory 'native', start a script that configures your source distributions build, change to the Apache 2 directory, edit the build script, build your mod_jk connector (with 'make') and finally install and copy it to the directory where it will be used by your webserver. With a little help from this blog post: http://egopoly.com/2007/10/29/how-to-install-tomcat-mod_jk-on-mac-os-x-leopard/

cd native
./configure --with-apxs=/usr/sbin/apxs
cd apache-2.0
Here you will need to edit 'Makefile.apxs' (see the Egopoly blog post). Edit the line after 'mod_jk.la' like this:
    $(APXS) -c -o $@ -Wc,"${APXSCFLAGS} -arch x86_64 ${JK_INCL}" "${JAVA_INCL}" "${APXSLDFLAGS} -arch x86_64 " mod_jk.c ${APACHE_OBJECTS}
After you have edited that line type:
make -f Makefile.apxs
sudo make install
These commands are rather different from the instructions in 'BUILD.txt' but have the same effect without the need to become superuser. You may test if Apache is OK with your setup by trying:
sudo apachectl configtest
I will write in a different post about configuring Apache and Tomcat.

3 comments | leave a comment

Your comment

* = Required.
Email addresses will never be published.
HTML is not possible, although a bit of Wiki syntax - like *bold* f.e. - is supported. You can make links when they are easily recognized as urls, f.e. www.toly.nl or http://tomcat.apache.org.
Off-topic or inappropriate comments will be deleted.

Actually with Snow Leopard there is no -arch option anymore in apxs. It simply compiles and installs without problems and no need to tweak the Makefile

wo 31 maart 2010 / Stefan Schubert

I believe your're right. I retraced my steps outlined above and found that you only needed to do:
  cd native
  ./configure --with-apxs=/usr/sbin/apxs
  cd apache-2.0
  sudo make install
And mod_jk.so is installed in its proper location.

ma 19 april 2010 / André → http://www.toly.nl

I found that it still works on Mac OS X Lion (10.7). I downloaded http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.32-src.tar.gz and typed the exact same lines.

wo 17 augustus 2011 / André → http://www.toly.nl

RSS feed

Tweet this article


Dit is de zoveelste incarnatie van mijn website wie nieuwsgierig is kan de

oudere 'recente' wijzigingen bekijken.

En ik heb hier een pagina waarop ik nieuwe en oudere versies van my_editors verzamel.