Installing Tomcat 8 on OS X Yosemite is actually quite easy. One can do it with the help of Homebrew or MacPorts, but I prefer to do it “by hand”. All you have to do is to follow the steps below.
First, head over to the Apache Tomcat download page and download the core binary distribution in the tar.gz format. Once downloaded, the rest of the work will be done within the Terminal. Start by extracting the downloaded archive.
cd ~/Downloads tar -zxvf apache-tomcat-8.0.20.tar.gz
The file name of course depends on the particular version that you downloaded. Once extracted, we will move the folder into the /usr/local directory, first ensuring that it exists (even though it should).
sudo mkdir -p /usr/local sudo mv ~/Downloads/apache-tomcat-8.0.20 /usr/local
Now we will remove any Tomcat installation that could theoretically already be at /Library/Tomcat and create a new symbolic link to the installation directory. By creating a symbolic link, the path to our Tomcat 8 installation is more convenient and can easily be updated if a new version of Tomcat is installed. Thus, we would not have to update configurations in applications that may be using Tomcat, such as an IDE.
sudo rm -f /Library/Tomcat sudo ln -s /usr/local/apache-tomcat-8.0.20 /Library/Tomcat
Now we will just set the owner of the directory and files recursively, and make sure that the scripts are executable.
sudo chown -R /Library/Tomcat sudo chmod +x /Library/Tomcat/bin/*.sh
At this point, Tomcat 8 should successfully be installed on your Mac. To start it, simply use the following commands.
cd /Library/Tomcat/bin ./catalina.sh start
Similarly, to stop it, use the following commands.
cd /Library/Tomcat/bin ./catalina.sh stop
That is it! You should now be able to access Apache Tomcat’s welcome page on http://localhost:8080. If you wish to make starting and stopping Tomcat 8 a little simpler, then you could create a few convenience commands on OS X.