This tutorial is a guide to installing and configuring Apache Tomcat 6 for use as a standalone Web server (for development) that supports servlets 2.5 and JSP 2.1. (Note: Apache Tomcat is sometimes referred to as "Jakarta Tomcat" since the Apache Java effort is known as "The Jakarta Project").
To configure this you require JDK 1.5 or greater, I choose following two packages for my installation
Installation of JAVA
The bin file is a self extract file run that file as
Once the rpm deployment is over, you will find the installation files on /usr/java
Now Set up a environment variable require for java in .bash_profile file
Why CLASSPATH - Since servlets and JSP are not part of the Java 2 platform, standard edition; you have to identify the servlet classes to the compiler. The server already knows about the servlet classes, but the compiler (i.e., javac) you use for development probably doesn't. So, if you don't set your CLASSPATH, attempts to compile servlets, tag libraries, or other classes that use the servlet and JSP APIs will fail with error messages about unknown classes.
Installing Tomcat 6
Extract the apache-tomcat-6.0.16.tar file as
[root@localhost ~]# tar –xvf apache-tomcat-6.0.16.tar
You’ll get a folder name apache-tomcat-6.0.16.
Rename this folder as tomcat6, and move to the location /usr/
[root@localhost ~]# mv apache-tomcat-6.0.16.tar /usr/tomcat6
Now Set up a environment variable require for tomcat in .bash_profile file
Here you have completed the installation and configuration of tomcat 6 and jdk 1.5.
Now to check that the setting is working properly, start the services of tomcat6 by running the startup.sh script. For stopping tomcat run shutdown.sh script.
[root@localhost ~]# ./ startup.sh
Go to browser and enter a url http://localhost:8080
, you will get a tomcat welcome page.