Main menu

Installing and configuring Apache Tomcat

Apache Tomcat is an open source Web server project for Java enterprise applications. It implements Java servlet, Java Server Pages, Java expression language and web sockets. Let’s start how to configure Apache Tomcat in your windows system.


  1. JDK (Java Developement Kit ) – Download
  2. Apache tomcat for windows – Download

Download Apache tomcat from above link and extract the zip file in your local drive, example c:\tomcat (I have rename the Tomcat directory apache-tomcat-xx-xx-xx to tomcat)

Create environment variables for Tomcat
JAVA_HOME as your JDK installation location.
TOMCAT_HOME or CATALINA_HOME as in your tomcat directory
Note: CATALINA is a codename of tomcat 5 and above.

Tomcat structure

bin: Binaries for start-up, shout-down related things.
conf : Tomcat configuration files like server.xml and web.xml.
lib: tomcat preinstalled library for all web applications.
logs: Contain tomcat logs files related to error and access.
webapps: Document root for your applications. You can put your applications here.
work: working directory for JSP to servlet communication.
temp: Temporary locations for files.

server.xml : server.xml is a initial configuration file for Tomcat and used for server wide configuration. example : server ports.
web.xml : In this file we define components of web applications. like servlet mapping. This file can we oerwritten by on application basis like in web applications WEB-INF/web.xml file.
tomcat-users.xml  : Managing users and roles.

Start and stop  your Apache Tomcat Server

Open your command prompt and navigate to Apache Tomcat startup binary.


Stopping the Apache Tomcat

Press Ctrl + c to stop Apache Tomcat or run