Women in Technology

Hear us Roar



Article:
  Integrating Tomcat with Apache Via the mod_jk Module
Subject:   How I installed Tomcat 4.1.27 on Mac OS X Server 10.2.8 (X-Serve)
Date:   2003-10-24 12:17:48
From:   anonymous2
HOW I INSTALLED TOMCAT 4.1.27 ON MAC OS X SERVER 10.2.8


1. Remove catalina.jar from /Library/Java/Extensions
2. Rename /Library/Tomcat --> /Library/Tomcat3
3. Install Tomcat 4 into /Library/Tomcat (http://developer.apple.com/internet/java/tomcat1.html)
4. Add file called start to CATALINA_HOME/bin with the following:
#!/bin/sh
echo "Starting Tomcat Server"
export CATALINA_HOME=/Library/Tomcat
export JAVA_HOME=/Library/Java/Home
$CATALINA_HOME/bin/startup.sh
5. Add file called stop to CATALINA_HOME/bin with the following:
#!/bin/sh
echo "Stopping Tomcat Server"
export CATALINA_HOME=/Library/Tomcat
export JAVA_HOME=/Library/Java/Home
$CATALINA_HOME/bin/shutdown.sh
6. Make them executable. (sudo chmod ug+x start stop)
7. Start Tomcat (sudo /Library/Tomcat/bin/start)
8. Test it out. (http://yourdomain:8080/)


GETTING TOMCAT 4.1.27 TO WORK WITH APACHE 1.3 VIA mod_jk ON MAC OS X SERVER
1. Shut down Tomcat and Apache
2. Make "/etc/httpd/httpd_macosxserver.conf" and "/etc/httpd/tomcat.conf" writeable.


3. Edit httpd_macosxserver.conf like so:
## Do not modify these directly; use Server Settings.
#
##<TomcatSupport>
##LoadModule jserv_module /usr/libexec/httpd/mod_jserv.so
##AddModule mod_jserv.c
##Include /private/etc/httpd/tomcat.conf
##</TomcatSupport>


##mod_jk settings for Tomcat 4
#<TomcatSupport>
#LoadModule jk_module /usr/libexec/httpd/mod_jk.so
#AddModule mod_jk.c
#Include /private/etc/httpd/tomcat.conf
#</TomcatSupport>


4. Edit tomcat.conf like so:
<IfModule mod_jk.c>
... (you can leave all of this here)...
</IfModule>


<IfModule mod_jk.c>
JkWorkersFile /Library/Tomcat/conf/workers.properties
JkLogFile /Library/Tomcat/logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


JkMount /examples/* ajp13
JkMount ...any other contexts in your webapps folder...
</IfModule>


5. Open Server Settings, Internet, Configure Web Service, General.
6. Check "Start Web service on system startup"
7. Check "Start Tomcat on system startup". (This may not work. If not, visit http://www.developer.com/tech/article.php/985561)
8. Start the Web Service.
9. Start Tomcat (sudo /Library/Tomcat/bin/start) and restart Apache (sudo apachectl restart).
10. Test it with http://yourdomain/examples/jsp/index.html or http://yourdomain/examples/servlets/index.html


jim at prunepatch dot org