Blogging for me started simply to document configuration types of things and a mometary recall and a search and WALA!! I found what I forgot. Young Terry Ferrell traversed over our NEW MAC and installed APACHE, TOMCAT AND MOD_JK.
The instructions are below!
Here are the steps I followed to build mod_jk and make it work with Apache 2.0.55 on Mac OS X:1. The apxs that the build wanted to use was in /usr/sbin. No matter what I passed to the --with-apxs parameter the only value that would build successfully was /usr/sbin/apxs. Unfortunately this was the Apache 1.3 version of apxs so the mod_jk that resulted was for 1.3. I eventually made a backup copy of /usr/sbin/apxs and took the apxs that was bundled with Apache 2.0.55 (from /sw/sbin/apxs) and copied it to /usr/sbin. This time the build worked. Of course, being on a Mac I had to sudo most of the commands:
A. sudo cp /usr/sbin/apxs /usr/sbin/apxs_old
B. sudo cp /sw/sbin/apxs /usr/sbin/apxs
C. cd ~/Desktop/jakarta-tomcat-connectors-1.2.15-src/jk/native #this is where the mod_jk source is
D. sudo ./configure --with-apxs=/usr/sbin/apxs
E. sudo make
F. sudo make install
At this point the mod_jk is in /usr/libexec and is called mod_jk.0.0.0.so. The installation requires the file to be placed in sw/lib/apache2/modules/mod_jk.so with proper right permissions
G. sudo cp /urs/libexec/mod_jk.0.0.0.so /sw/lib/apache2/modules/mod_jk.so
H. sudo chmod 755 /sw/lib/apache2/modules/mod_jk.so
2. Now that mod_jk is built, Apache's configuration needs to be modified:
sudo vi /sw/etc/apache2/httpd.conf and add this to the end of the LoadModule section:
LoadModule jk_module /sw/lib/apache2/modules/mod_jk.so
After trying to start Apache it complained about missing libraries.
3. Add the libraries that mod_jk is depending on:
A. Using fink, download the src version of apache2-dev
B. Using fink again, download the src version of apr
Now Apache should start with the mod_jk added to it. To finish the changes to make Apache talk to Tomcat:
A. Add these lines to the end of the httpd.conf file:
JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/tomcat/logs/mod_jk.log"
JkLogLevel emerg
JkMount /* ajp13
B. Create a file called workers.properties and put it in the Tomcat conf/jk directory:
a. sudo mkdir /usr/local/tomcat/conf/jk
b. sudo vi /usr/local/tomcat/conf/jk/workers.properties
c. add these lines to workers.properties:
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
C. Stop and restart Tomcat. The following url should work in the browser:
http://localhost:8080/index.jsp
D. Stop and restart Apache. The following url should work in the browser:
http://localhost/index.jsp
tags: mac intel duo modjk apple tomcat open source mac os x apache modjk apache young terry ferrell mac osx
links: digg this del.icio.us technorati reddit