Tomcat - open source web server and servlet/JSP container

Published: Friday, 5 September 2008

Tomcat is an Open Source web server, and a Servlet/JSP Container.


Base and Home

It is possible to run multiple tomcat instances on a single server, or on your own computer for development.

The CATALINA_HOME environment variable should point to the common installation directory.

While CATALINA_BASE should point to your instance specific configuration directory. Your instances would typically be configured with different ports.

Directory Listing

To turn it off for the default servlet, edit the listings param in conf/web.xml in the tomcat directory.


Attribute value is quoted with " which must be escaped when used within the value

Escape your attributes with ' or \"

Otherwise use the JVM parameter -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false


In the server.xml of your tomcat instance, there is a Server element. You can specify to shutdown the tomcat server by sending a command to a TCP port.

<Server port="18305" shutdown="SHUTDOWN">

If the above is configured, you can use for the following command to start a shutdown

echo SHUTDOWN | nc localhost 18305

Major Versions

7.0.x tomcat provides 3.0 Servlet, 2.2 JSP spec, and requires java 1.6

6.0.x tomcat provides 2.5 Servlet, 2.1 JSP spec, and requires java 1.5

5.5.x tomcat provides 2.4 Servlet, 2.0 JSP spec, and requires java 1.4. This reaches end of life 2012-09-30.


Tomcat servlet container