Install Apache Tomcat on Mac OSX

There are a few steps to follow:

  • Download latest version of tomcat -> Apache Tomcat Homepage
  • Extract it and rename the folder to “Tomcat”
  • Now move it to /Library folder with this command (after “cd”ing to the folder before the unzipped one, apache version may changes)
    • mv apache-tomcat-6.0.26 /Library/Tomcat
  • Get a script to simplify tomcat starting and stopping
#!/bin/bash
case $1 in
start)
sh /Library/Tomcat/bin/startup.sh
;;
stop)
sh /Library/Tomcat/bin/shutdown.sh
;;
restart)
sh /Library/Tomcat/bin/shutdown.sh
sh /Library/Tomcat/bin/startup.sh
;;
*)
echo “Usage: start|stop|restart”
;;
esac
exit 0
  • Put it in a file named “tomcat” and move it to /usr/bin (“chmod +x tomcat” before run it)
  • Now set the system variable “JAVA_HOME” to “/Library/Java/Home” using $ENV preference panel (Simple)
  • Now use tomcat “tomcat start” and stop it with “tomcat stop”
Advertisements

One response to “Install Apache Tomcat on Mac OSX”

  1. oleg says :

    ага, буду знать

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: