Women in Technology

Hear us Roar



Article:
  Integrating Tomcat with Apache Via the mod_jk Module
Subject:   Fixes that make it work
Date:   2002-12-18 23:31:01
From:   potel
OK, here's what you need to get this to work.


First, I'm on OS X 10.2.2, which comes preinstalled with Apache 1.3.27. I first followed the memo at http://developer.apple.com/internet/java/tomcat1.html
and got Tomcat to work standalone but could not get their webapp-style integration with Apache going.


An easier way to install Tomcat is go to http://www.serverlogistics.com/downloads-jag.php#tomcat and download that, currently 4.1.12. The result is a double-clickable Tomcat installer. Note this puts Tomcat in /Library/Tomcat not in /usr/local/jakarta-tomcat-4.x.x like the Apple instructions. It gives you start, stop, and restart commands, see their ReadMe. This version supposedly is ready to go with Apache 2 but use it anyway just for the easy Tomcat install.


Here are the necessary fixes to Chad's otherwise fine memo:


Get dlcompat from http://www.opendarwin.org/projects/dlcompat


There is no build-hpux-cc.sh, so make your own from Chad's memo or use his copy from "available here" in paragraph 1 of Building mod_jk.


You shouldn't need to modify JAVA_HOME, but you need to modify DLCOMPAT_HOME to point to the dlcompat-yyyymmdd directory you downloaded.


In workers.properties, the tomcat_home line need to point to where you installed Tomcat, for me:


workers.tomcat_home=/Library/Tomcat


Also, as someone else pointed out, the correct last line is:
worker.ajp13.type=ajp13


The JkWorkersFile command is three separate lines. You need to point at your Tomcat directory, and there is no jk subdirectory under conf. Here are the correct lines (given my Tomcat location):


JkWorkersFile /Library/Tomcat/conf/workers.properties


JkLogFile /Library/Tomcat/logs/mod_jk.log


JkLogLevel debug


Using ServerName 127.0.0.1 will only work locally on your Mac, you need to change this to the Network Address shown in System Preferences under Sharing:


ServerName your-Network-Address


The VirtualHost command also has to be broken into separate lines. Use the same Network Address as above. You need to point to your Tomcat directory as before. And you need to use ajp13 throughout not ajp12. Here are the correct lines:


<VirtualHost your-Network Address>
DocumentRoot /Library/Tomcat/webapps
JkMount /*.jsp ajp13
JkMount /examples/servlet/* ajp13
</VirtualHost>


That's it, have fun!




Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Fixes that make it work *sortof*
    2003-04-24 22:13:32  anonymous2 [View]

    Well, thanks for your work on this, it is greatly appreciated by us newbies. I only have one problem, and I believe it is related to the whole VirtualHost part of this. I make backup copies of every config file I modify, and when I use the
    <VirtualHost your-Network Address>
    DocumentRoot /Library/Tomcat/webapps
    JkMount /*.jsp ajp13
    JkMount /examples/servlet/* ajp13
    </VirtualHost>
    config, I get a 403 Forbidden error when connecting to 127.0.0.1, when I use the previous backup of the config, which conatins all of your suggested alterations minus the VirtualHost the error does not present itself. Have I missed something in my config perhaps?
  • Fixes that make it work
    2002-12-24 21:28:41  spiffysj [View]

    Hello-

    Thanks for the corrections! Did you have to change permissions along the way? When I try to run the servlet and JSP examples, I get an "Internal server error". It works fine when I go through port 8080, so I'm assuming it's an issue with the mod_jk connector? I tried my compiled version, as well as the version the author provided.

    Thanks!