Tomcat Installation Instructions for Jakarta-Tomcat version 3.2.1 and Mac OS X Pulic Beta...
1. Unpack the tomcat source and change the root directory to a name of your choice. I have made the root directory /Local/Library/Tomcat. For the remainder of this document, we will assume $TOMCAT_HOME is set to the installation root.
================================================== ============
INSTRUCTIONS FOR GETTING TOMCAT TO RUN WITH APACHE VIA MOD_JK
================================================== ============
1. For some reason, the source code for the mod_jk.so module is missing from the production release (version 3.2.1) of Tomcat, so we will have to find a more recent release. Find the SOURCE package for Tomcat 3.3 and unpack it wherever you wish. (You can put this in a temporary directory ie. under your home directory if you wish. You won't need any of it after these steps are complete.
2. Get
http://fink.sourceforge.net/files/dl...0010123.tar.gz and unpack it anywhere. Enter the directory, change to root (via "su" is fine) and type "make install".
3. Once last thing before you can now delete the directory. Copy the file dlopen.c to Tomcat source (version 3.3) directory src/native/mod_jk/apache1.3 (mentioned in the next step)
Note: this step should HOPEFULLY be unnecessary once the final release of OS X is out.
4. In the Tomcat 3.3 source directory, go into src/native/mod_jk/apache1.3 and execute (as root)...
/usr/sbin/apxs -o mod_jk.so -I../common -I/System/Library/Frameworks/JavaVM.framework/Headers -I. -DFREEBSD -c mod_jk.c ../common/*.c dlopen.c
5. Now assuming you get no errors, there will be a file called mod_jk.so which you will copy to /System/Library/Apache/Modules
6. Before you proceed with this step, make sure you have started Tomcat successfully at least once. You will need to make sure there s a file called $TOMCAT_HOME/conf/mod_jk.conf-auto. This file will get auto-regenerated every time Tomcat starts up, and it will instruct Apache as to which (static) pages to handle itself and more specifically, which requests (servlets and JSP and XML) to pass over to Tomcat. There is one small glitch that we need to fix: this file instructs Apache to look for mod_jk.so in a directory that doesn't exist. We shall therefore have to create a symlink to redirect it to the correct place.
(As root) execute the following command:
ln -sf /System/Library/Apache/Modules /Library/WebServer/libexec
7. Next, edit the file /Library/WebServer/Configuration/apache.conf and append the the very last line....
Include /Local/Library/Tomcat/conf/mod_jk.conf-auto
(or replace "/Local/Library/Tomcat" with whatever you have as your $TOMCAT_HOME)
8. Let's try everything out! Startup Tomcat again if you haven't already. Then shutdown and restart apache via...
/usr/sbin/apachectl restart
and hope you get no errors!!
Now, test Apache normally by browsing
http://localhost/.
If that works, now try
http://localhost/examples/servlets/index.html and try to execute some of the sample servlets. If all goes well, you are done!
If you would like to enable Apache/Tomcat to serve XML files, follow my Cocoon-1.8.1 installation instructions.