Installing Tomcat on Mac OS X

We will be using Tomcat for our application server. Tomcat is an open source web server and servlet container developed by the Apache Software Foundation. Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Oracle Corporation, and provides a “pure Java” HTTP web server environment for Java code to run.

Here is how to install Tomcat on Mac OS X and get it up and running quickly:

1. Download tomcat

I downloaded Tomcat 6 which is not the latest version but it supports java 1.5 and 1.6, while Tomcat 7 only supports java 1.6. But whichever version you download is up to you. Go to the apache site and download tomcat. I went here

and downloaded the binary distribution called “tar.gz”

2. Install tomcat

Unzip tomcat download, rename folder to “tomcat” and go into Finder and place folder here:
Macintosh HD/usr/local

Now it is installed! You may want to make a text file inside the tomcat folder, with the version information.

Can’t find your usr folder inside your Macintosh HD? You need to show your hidden files!

Open a new TERMINAL window and enter the following:

$ defaults write AppleShowAllFiles TRUE
$ killall Finder

3. Start tomcat

Open TERMINAL and enter the following:

Though it is not always necessary, you might need to enter the chmod command below to give permission to launch a .sh script.

$ cd /usr/local/tomcat/bin
$ chmod +x
$ sh

4. Open a browser…

Enter http://localhost:8080/ and see that you get the default tomcat page. That means it is running.


Post a Comment