Tomcat configuration summary

Tomcat is one of the more involving servers to setup. It contains a rather large server.xml file that can be daunting at first. If you “break down” the massive xml file into containers however, it becomes a lot more understandable. Below is a diagram I drew up during my studies:

tomcatsummary (2)

For a better (printable) view:

The diagram should help to make it clearer. The tomcat5.conf file contains variables which control the JAVA server and filepaths referred to from within server.xml

The server.xml file itself is split into “levels” which I call “containers” in the diagram. Each container can contain other “child” containers, which are influenced by the attributes specified within the “parent” container. So for example, if the debug valve in the Engine container is switched on, it will log traffic to all the hosts, since the hosts container is a child of the engine container.

Some of the more important container attributes are:

<Host> container
The path to this Host’s webapps directory (the directory in which webapp directories and/or WAR files reside). This can be a path relative to CATALINA_HOME, or an absolute path.

Another fully qualified hostname for the same Host container.


<Context> container
This is the path (relative or absolute) to the webapp’s unpacked directory or WAR file. If you specify a relative path, the path is relative to the Host’s appBase directory. Do not set a value for docBase that contains the value of appBase at the beginning of the value. For example, if appBase=”deploy”, do not choose a docBasevalue such as “deployment-webapp“. Doing so will lead to deployment errors.

The URI path relative to the root of the web server (”/“) where this webapp should be mapped. Set this to an empty string (“”) to denote that the webapp should be the root webapp. This attribute cannot be set unless the Context element is inside the server.xml file.



<Engine name=”Catalina” defaultHost=”localhost”>
<Host name=”localhost” appBase=”webapps”>
<Context path=”” docBase=”ROOT”/>
<Context path=”/orders” docBase=”/home/ian/orders”
reloadable=”true” crossContext=”true”/>
<Host name=”” appBase=”/opt/”>
<Context path=”” docBase=”ROOT”/>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s