Here's what I did:
- Enable the jk_module for Apache. This is activated in Server Admin -> Web -> Setting -> Modules. Select the enabled checkbox by the jk_module and hit Save. This will restart the Apache server.
- Copy from /Library/Tomcat the conf, logs, temp, webapps and work directories to your sites folder -- e.g. /Library/WebServer/Documents. You should now have:
Each directory would have all their contents, too./Library/WebServer/Documents/conf /Library/WebServer/Documents/logs /Library/WebServer/Documents/temp /Library/WebServer/Documents/webapps /Library/WebServer/Documents/work - I created a web directory to hold my jsp files (/Library/WebServer/Documents/web). And placed my JSP files in there.
- You'll need to run a new instance of Tomcat on port 80, so you need to edit you new server.xml file for your Tomcat instance:
Find where it says port 9006 and change it to port 80. You'll also need to change the examples directory your "web" directory for Tomcat to look for JSP files. Find:pico /Library/WebServer/Documents/conf/server.xml
Replace with:<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="9006" minProcessors="5" maxProcessors="75"
Find:<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="80" minProcessors="5" maxProcessors="75"
Replace with:<!-- Tomcat Examples Context --> <Context path="/examples" docBase="web" debug="0" reloadable="true" crossContext="true">
Find:<!-- Tomcat Examples Context --> <Context path="/web" docBase="web" debug="0" reloadable="true" crossContext="true">
Replace with:WebAppDeploy examples warpConnection /examples/WebAppDeploy web warpConnection /web/ - Create a script called mytomcat.sh to start Tomcat using your website folder as base directory:
#!/bin/sh # set the environment CATALINA_BASE=/Library/WebServer/Documents CATALINA_HOME=/Library/Tomcat JAVA_HOME=/Library/Java/Home JAVA_OPTS=-server export CATALINA_BASE CATALINE_HOME JAVA_HOME JAVA_OPTS exec "$CATALINA_HOME"/bin/catalina.sh "$@" - Give mytomcat.sh execute permisions":
chmod 755 mytomcat.sh - Restart Tomcat.
sudo ./mytomcat.sh stop sudo ./mytomcat.sh start

