Run the following commands to download the Tomocat:
tomcatVersion="8.0.33"
tomcatTempDirectory="~/Downloads/Tomcat/"
wget http://apache.cbox.biz/tomcat/tomcat-8/v$tomcatVersion/bin/apache-tomcat-$tomcatVersion.tar.gz $tomcatTempDirectory
Open to Terminal app to move the unarchived distribution to /usr/local
sudo mkdir -p /usr/local
sudo mv $tomcatTempDirectory/apache-tomcat-$tomcatVersion /usr/local
To make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Tomcat (after removing the old link, you might have from installing a previous version):
sudo rm -f /Library/Tomcat
sudo ln -s /usr/local/apache-tomcat-$tomcatVersion /Library/Tomcat
Change ownership of the /Library/Tomcat
folder hierarchy:
# id can retrieve information for current user (username, groups, etc)
sudo chown -R <your_username> /Library/Tomcat
Make all scripts executable:
sudo chmod +x /Library/Tomcat/bin/*.sh
Instead of using the start and stop scripts, like so:
/Library/Tomcat/bin/startup.sh
and now your Tomcat instance is ready to use. Open follow address: http://localhost:8080
Source: