Sporadically delivered thoughts on Continuous Delivery

Configuring the Tomcat Manager Webapp

| Comments

I like to have the Tomcat manager webapp installed on each instance, so I can play with the webapps, and see how many active sessions there are. To do this, make a file called manager.xml file in $CATALINA_BASE/conf/[Engine]/[hostname]/. Following the default Tomcat installation, this would be $CATALINA_BASE/conf/Catalina/localhost.

An example of what mine typically looks like is below:

<Context path="/manager"

    <ResourceLink name="users"

    <Valve className="org.apache.catalina.valves.RemoteAddrValve"


The key bit is the docBase attribute, which needs to point to the webapp in the Tomcat installation directory. I add a RemoteAddrValve to keep evil people from trying to break into the manager.

You’ll also need to add a user account with permission to use the manager. Put a file called tomcat-users.xml into the conf directory of the Tomcat instance, which should have something like the following:

  <role rolename="manager"/>
  <user username="admin" password="hard2Guess" roles="manager"/>

Finally, your server.xml file needs to have a UserDatabase configured. This is in the example configuration files from the Tomcat installation.