Sunday, September 28, 2014

Installing Tomcat 8.0.x on OS X

Prerequisite: Java

On OS X 10.9.x (Mavericks) Java is not installed by default anymore, at least not initially.The easiest way to get Java on your Mac is to open the Terminal app and type ‘java’. You will be asked if you want to install Java and OS X will take care of the rest - you just need to follow the instructions and you’ll end up with Java 7. This involves sending you to the Oracle’s Java SE web page where you will need to select the appropriate JDK (JDK 7u67 as of this writing) for download and installation.

The JDK installation package comes in a dmg and installs easily on a Mac. In the same or different Terminal app window entering:

java -version

Will now show something like this:

java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Confirming you have successfully installed Java 7.

Installing Tomcat

Now comes the Apache Tomcat installation, which is actually quite easy.

1. Download a binary distribution of the core module (apache-tomcat-8.0.12.tar.gz).

2. Using any available unarchive tool, unarchive the file from the Downloads folder to ‘/usr/local’. You likely will need Administrative privileges for this step. You can unarchive the file contents to another location of our choosing, I chose ‘/usr/local’ since it’s my standard and will centralize Tomcat.

3. To make things easier in future for transparent release updates, create a symbolic link for your location (‘/usr/local/apache-tomcat-8.0.12’) to the library location:

sudo ln -s /usr/local/apache-tomcat-8.0.12 /Library/Tomcat

4. Permissions and mode should be okay (it was for me), but to make sure you can run the below:

sudo chown -R /Library/Tomcat
sudo chmod +x /Library/Tomcat/bin/*.sh

5. Startup your Tomcat instance:


6. Verify things are working by opening a browser window/tab using the default URL (http://localhost:8080) and take a look at the default page.

Everything should be functional and now ready for your customizations and/or deployments.