I’ve made the switch over to Apple on my development machines and as I’m starting my new company soon I’ve got myself a new MacBook Pro machine of which I will be transporting to and from the office so I’ve been installing my entire development on it and thought I’d blog about how to set-up Tomcat 7 on MacOSX to use as a development environment… It’s rather straight forward but thought I’d post it up anyway to help others!
Sudo mv /Downloads/apache-tomcat-9.0.35 /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).
Mainly for Web Development project you need Web Server. Apache Tomcat is the best production ready web container. By default when you download Eclipse IDE, it doesn’t come with Tomcat install with it. In this tutorial we will go over all detailed steps to configure Apache Tomcat successfully in Eclipse environment. Have any of below questions? I found an article on how to install tomcat: Tomcat on a Mac. I got the Tomcat server running to where i can see the default Tomcat Page. Started to dig deeper but hit a huge wall on getting to a point where i could use an IDE to get coding. I downloaded Eclipse for the mac (because it was free and seemed to be the more popular one out there).
Tomcat 7 is the first release of Tomcat to support the Servlet 3.0, EL 2.2 and JSP 2.2 specifications.
Tomcat 7 requires Java 1.6 to be installed on your Apple Mac based computer, if your running Leopard (10.5) or Snow Leopard (10.6) you are good to go already as these versions of OSX comes pre-installed with Java, however users of OSX Lion (10.7) and more than likely Mountain Lion (10.8) will need to enable Java of which I’ll now explain how to do so, if your not using Lion or Mountain Lion you can skips to the main install notes now!
You can enable and install Java on Lion and Mountain Lion using the following guide: http://helpx.adobe.com/x-productkb/global/install-java-jre-mac-os.html
You can also check (to be on the safe side) your version of Java that you have installed on your machine by running the following command from the terminal:-
1) First step is to download Tomcat from the Apache Tomcat website or which can be found here: http://tomcat.apache.org/download-70.cgi, Scroll down to the ‘Binary distrubutions’ section and download the ‘.tar.gz’ file. At the time of writing the version I downloaded and installed was 7.0.29
2) Opening or un-archiving the download will now create a new folder – more than likely this will be in your downloads folder unless you choose a different folder to download the file to.
3) Our next step is to ‘move’ the extracted folder to a system location of which we will run Tomcat from, we do this like so (obviously change your version number/download directory to suite your requirements):-
To make it easy to switch and upgrade Tomcat versions in future we’ll use a symbolic link to alias the tomcat folder, we do this like so:-
We now need to change the ownership of the /Library/Tomcat folder:-
We now need to set all the scripts under ‘/Library/Tomcat/bin’ to executable, we do this like so:-
You’ve done it! – You can start Tomcat manually by running:-
You can stop it by running:-
Apache Tomcat 8 Free Download
Tomcat is now installed and working, you should be able to access it on your machine using this URL: http://localhost:8080/
In a development environment, instead of having to open up the console each time, I have found a handy little tool that allows you to easily Stop, Start and open up the Tomcat enviroment… Its called ‘Tomcat Controller’ and can be downloaded from here: http://www.activata.co.uk/tomcatcontroller/
It provides a nice interface as shown below:-
You will however need to open up the ‘Preferences’ and change the Tomcat location to match your new set-up.
Apache Tomcat is an open source web server by Apache Software Foundation. Apache Tomcat is used to host Java server pages and Java Servlet. Basically its a Java web server. Its a well matured web server and largely used in the industry.
Tomcat 7.0 Download
Install on Mac
Installing Tomcat on Mac is quite simple. Download the binaries from the Apache Tomcat website. Download the stable version from the website. There are Alpha, Beta and Stable versions are available on the Tomcat site. At the time of writing this post Tomcat 8 version is latest and stable one. Download the tar.gz file. And extract on local disk. Before that make sure you have JDK installed on your Mac and Java Home variable is set. Once you extract the files, that is it. You successfully install the Tomcat on your Mac.
Start and Stop Tomcat
To run Tomcat on mac, open the terminal window and goto bin folder of the extracted folder. Than run the following command on the terminal window ./catalina.sh start . If tomcat is successfully installed you will see the message Tomcat Started on the terminal window as you can see in the below screen shot.
Tomcat normally start at port 8080, if this port is not used by any other application. Browse the localhost with the following URL http://localhost:8080/ . And you will see a screen as shown below.
To stop the Tomcat type the following command in terminal window ./catalina.sh stop .
Deploy WAR file
Apache Tomcat Server 8 Download For Mac
There are two ways to deploy a war file in Tomcat you can use anyone of it.
- Hot Deployment: It mean deploy WAR file when server is up and running.
- Cold Deployment: It means deploy WAR file when server is not running.
You can copy the war file on the following path of Tomcat /apache-tomcat/webapps . Once the WAR file is copied you will notice it will immediately extracted and a folder with the same name will be created.