Pr.Pg Next Pg

Setting up Web Server: Tomcat tutorials

  • There are many Web Server which supports Java Server Pages and Servlets API, Some web servers are open source and are freely available and Tomcat is one of them.

  • Apache Tomcat is an open source web server developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the Java Server Pages (JSP) specifications from Sun Microsystems now acquired by Oracle Corporation, and provide a "pure Java" HTTP web server environment for Java code to run in. Here are the steps to setup Tomcat on your machine:

  1. Go to http://tomcat.apache.org/ for downloading latest version of Tomcat.

  2. Once you downloaded the installation, unpack the binary distribution into a convenient location. For example in C:\apache-tomcat-6.0.20 on windows, or /usr/local/apache-tomcat-6.0.20 on Linux/Unix and create CATALINA_HOME environment variable pointing to these locations.

  3. If you want to start Tomcat on Windows machine then use the following command:

C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.20\bin\startup.bat

Or

%CATALINA_HOME%\bin\startup.bat

  1. If you want to start Tomcat on Unix, Linux, Solaris etc machine then use the following command:

/usr/local/apache-tomcat-6.0.20/bin/startup.sh

Or

%CATALINA_HOME/bin/startup.sh

  1. After startup, the default web applications included with Tomcat will be available by visiting http://localhost:8080/. If everything is fine then it should display following result:

 

Tomcat Home page

 

Further information about configuring and running Tomcat can be found in the documentation included here, as well as on the Tomcat web site: http://tomcat.apache.org

  1. If you want to stop Tomcat on windows machine then below is the command:

C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.20\bin\shutdown

  1. If you want to stop Tomcat on Unix, Linux or Solaris machine then below is the command:

/usr/local/apache-tomcat-6.0.20/bin/shutdown.sh

Pr.Pg border                                              Next Pg