OSX: Installing tomcat on 10.6

TO INSTALL TOMCAT

1. Download jakarta-tomcat-x.x.xx.tar.gz

2. Unzip to /usr/local/tomcat-x.x.xx/

3. Create symlink tomcat

cd /usr/local/
ln -s /usr/local/tomcat-x.x.xx/ tomcat

4. Use the following script to start/stop tomcat
#!/bin/bash

export CATALINA_BASE=/usr/local/tomcat
export CATALINA_HOME=/usr/local/tomcat
export CATALINA_TMPDIR=/usr/local/tomcat/temp
export JRE_HOME=/*dir to java home*/
export CLASSPATH=/usr/local/tomcat/bin/bootstrap.jar

if [ "$1" == "start" ]; then
$CATALINA_HOME/bin/startup.sh
elif [ "$1" == "stop" ]; then
$CATALINA_HOME/bin/shutdown.sh
else
echo "Command: tomcat [start|stop]"
fi

5. Assuming the script's path is ~/tomcat, start the server using

~/tomcat start

6. Assuming the script's path is ~/tomcat, stop the server using

~/tomcat stop

No comments: