This is for installing tomcat as a daemon on port 8080 but enable also port 80 by using a firewall redirection. It was tested on Mac OS 10.6 but should work also with 10.5.
Edit /opt/local/share/java/tomcat6/conf/server.xml and add proxyport="80" URIEncoding="UTF-8" inside <Connector .../>.
For forwarding port 80 to 8080 run this line and add it do /bin/catalina.sh:
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
Assign enough memory to the Java machine or you may be in trouble later. Inside /opt/local/share/java/tomcat6/conf/local.env
export JAVA_JVM_VERSION=CurrentJDK export JAVA_OPTS="-Xmx3000M -Xms3000M -Djava.awt.headless=true -Duser.timezone=UTC"
In my example I allocated ~3Gb or RAM but you can adapt this, anyway don't put less than 1GB if you are running hudson inside tomcat.
Running as a service
Run nano /Library/LaunchDaemons/org.apache.tomcat.plist and paste the code below:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>Label</key> <string>org.apache.tomcat</string> <key>ProgramArguments</key> <array> <string>/opt/local/share/java/tomcat6/bin/catalina.sh</string> <string>run</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
Check that launchd detected you new daemon, if not reboot :(
launchctl list|grep tomcat
Start tomcat manually.
launchctl start org.apache.tomcat
If the status is something else than -, you have a problem and you should investigate it: launchctl log level debug and check /var/log/system.log.