Tomcat Instance Notes

Tomcat can have multiple instances. For these examples I will assume that you have tomcat installed at /usr/local/tomcat.


You will need a directory that will be the $CATALINA_BASE. I'm going to use /usr/local/my-instance. You will need the following directories:


# Cheat
mkdir -p /usr/local/my-instance/{conf,logs,temp,webapps,work}

Copy the server.xml and web.xml files from your tomcat install, place in your new conf folder, and modify to your liking. At the very least you will have to make some changes to server.xml:

  • The <Server> tag will need a different value for its port.
  • The <Connector>s will need to be on different ports as well (HTTP, AJP, etc).

To start and shutdown you need only to tell tomcat where your new instance is:

CATALINA_BASE=/usr/local/my-instance /usr/local/tomcat/bin/
CATALINA_BASE=/usr/local/my-instance /usr/local/tomcat/bin/


To have a Tomcat Manager running on your new instance, create $CATALINA_BASE/conf/Catalina/localhost/manager.xml.

To have it use the same manager and settings/users as your main install:

<Context path="/manager" privileged="true" docBase="/usr/local/tomcat/webapps/manager"/>

Point your UserDatabase in server.xml to the tomcat-users.xml file in your main install:

<Resource name="UserDatabase" auth="Container"
    description="User database that can be updated and saved"