HOW-TO: Building and configuring mod_jk on OS X (Tiger)

Brief HOW-TO building and configuring mod_jk on OS X (Tiger)

  1. Download the mod_jk source: http://www.apache.org/dist/tomcat/tomcat-connectors/jk/source/jk-1.2.15/jakarta-tomcat-connectors-1.2.15-src.tar.gz

  2. Expand and cd to jakarta-tomcat-connectors-1.2.15-src/jk/native

  3. ./configure --with-apxs=/usr/sbin/apxs

  4. cd apache-1.3/

  5. make -f Makefile.apxs

  6. sudo cp mod_jk.so /usr/libexec/httpd/

  7. sudo chmod ugo+x /usr/libexec/httpd/mod_jk.so

  8. Create a workers prop file:

    workers.tomcat_home=/usr/local/tomcat
    workers.java_home=/Library/Java/Home
    
    worker.list=myworker
    
    worker.myworker.type=ajp13
    worker.myworker.host=localhost
    worker.myworker.port=8009
    worker.myworker.socket_keepalive=1
    
    This file will be referenced by the mod_jk configuration section in /etc/httpd/httpd.conf, so it can be placed anywhere, as long as subsequent references have the correct path. By convention it is usually placed in the Tomcat server's conf dir (e.g. /usr/local/tomcat/conf/worker.properties).

  9. Add the following to the end of /etc/httpd/httpd.conf:

    LoadModule jk_module libexec/httpd/mod_jk.so
    
    JkWorkersFile /usr/local/tomcat/conf/worker.properties
    JkLogFile /private/var/log/httpd/mod_jk.log
    JkLogLevel trace
    
    JkMount /* myworker
    

  10. sudo apachectl restart

All requests sent to the Apache host will now be forwarded on to the Tomcat server.