Monday, February 14, 2011

Basic Apache Tomcat Installation - Step by Step

Prerequisite: Tomcat engine is a Java program so before you start installing tomcat you should have Java installed. That’s the only pre-requisite for Apache Tomcat.
Step1:  Download Tomcat.
There are two types of downloads available:
-          Binary distribution – Where you can simply download the binaries and use them.
-          Source Code – Complete source which developers can compile. Useful for any customization/tunings a developer might need to do.
During download you also want to make a choice if you want to install tomcat as a service or not.
If on a windows system you want to run tomcat as a service then from the core distribution you can select 32/64 bit Windows Service Installer. It is a GUI installer that will install tomcat on your machine. The normal 32bit Windows or other code distribution packages contains tomcat binaries in its directory structure. Users can simply keep this and start and stop tomcat from /bin/startup or /bin/shutdown batch or sh files depending on which platform they are running it.
Step2:  Configuring.
To start using tomcat there isn’t any configuration as such. You can simply start using tomcat as is from this stage. The only item you need to keep in mind is that you have Java installed and proper environment variable is set.
Set JAVA_HOME environment variable to the folder that contains JDK.

Step3: Starting Tomcat.
If you have download tomcat as a zip all you need to do is unzip it, navigate to bin folder and run startup.bat to start tomcat. Once started successfully it shall give you a message in command window saying server startup in xyz seconds.
You can also open IE and navigate to http://localhost:8080/ if you see a page displayed about tomcat that means you have successful installed and configured tomcat.
By default tomcat runs on 8080 port.
Step4: Stop Tomcat
From /bin folder use shutdown.bat script. Or simply close the command windows that came up when you started tomcat.

Step5: Looking for errors
If there were some errors during tomcat startup you can find them in Catalina files of /log folder.

No comments:

Post a Comment