The Manager Webapp

The Manager web application lets you manage your web applications through the web. Of course, if anybody could manage everybody else's web applications, things might get a bit touchy, not to mention insecure. So, you have to do a couple of things to make the Manager web application work and work properly.

The Manager webapp starts automatically by default in Tomcat versions 4.1.31 and higher (though you really should run Tomcat version 6.0 or higher). But, you must properly configure CATALINA_HOME/conf/tomcat-users.xml for it to allow you to log in.

If you're using a UserDatabaseRealm—the default—you'll need to add the user to the tomcat-users.xml file, which is more fully discussed in Chapter 2. For now, just edit this file, and add lines like this after the existing user entries (changing the password to something a bit more secure):

<role rolename="manager"/>
<user username="iadmin" password="deep_dark_secret" roles="manager"/>

Save the file, and the next time you restart Tomcat, you will be able to log in and use the Manager web application. The URL to the HTML user interface of the Manager webapp is http://localhost:8080/manager/html.

The Manager webapp is actually designed for use within another program. Unmodified, it just generates a list of the web applications you have deployed and depends on servlet parameters for its codes; if you wish to use it like this, see the documentation that comes with Tomcat. We find it a bit laconic. It just prints the following ...

Get Tomcat: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.