Chapter 4. Tomcat-Bundled Web Apps

Table of Contents

Manager Webapp details
Admin Webapp details

You should understand that Tomcat comes with some web apps installed in the $CATALINA_BASE webapps directory, and some installed to a shared location and referenced by a context XML file under $CATALINA_BASE/conf/Catalina/localhost. The Tomcat Manager web app lists all installed web apps.

Most importantly, become familiar with the Tomcat Manager web app. There are a couple quirks to it, but it's a great way to check on your web apps and to interactively start, stop, and deploy them. If you do a normal install, all you need to do to use the manager web app is to edit $CATALINA_BASE/config/tomcat-users.xml to add a record for a user with role "manager". Then (unless you have removed or replaced the ROOT web app), go to the home page and click on the link for Tomcat Manager. If you don't have the default ROOT web app in place, then use the URL http://yourhost:XXX/manager/html (replace XXX with the port you are running on).

Manager Webapp details

The Manager uses the <display-name> from web.xml as the web application titles, not the <description>.

There is no "re-deploy". You have to "Undeploy" then "Deploy" again.

To deploy a war file local to Tomcat, you must specify "WAR... URL" like jar:file:/path/to/bar.war!/ If everything is ok, context root will be "/filebasename" and the app will be started.

See the Tomcat Quirks chapter about quirks.

The Tomcat Administration web app is often useful. You can use it to manage shared server resources such as ACLs, user lists, data sources, mail servers. Unfortunaly, the app isn't really production-ready, and most of the functionality is highly dependent upon exactly how you have your shared resources set up. If you do a normal install, all you need to do to use the manager web app is to edit $CATALINA_BASE/config/tomcat-users.xml to add a record for a user with role "admin". Not sure about 5.0.x, but with 5.5.x, your server.xml file must contain the four Admin webapp LifecycleListener <Listener> tags, which you can copy from one of the supplied sample server.xml files.

Admin Webapp details

I sure wish I had time to make the Admin Webapp reliable and consistent, because what works is really useful. Many operations will get screwed up if you don't let them complete before doing something else, so always pause after making significant changes or Committing.

Some operations cause the Admin webapp itself to restart, and you will have to log in again (without any indication of why).

Many changes will not take effect until you restart Tomcat, but a few are effective immediately (like changes to valves).

Many changes require Committing to persist them, but several do not (like User and Role changes).

See the Securing Tomcat's Administrative Web Apps chapter to learn my suggested method to secure your administrative web apps in a simple and efficient way.

The jsp-examples, servlets-examples, and tomcat-docs web apps are immensely useful to have on-hand for day-to-day J2EE developerment. Leave these apps running on your development servers!

I don't know anybody who uses Tomcat clustering or load balancing. I'm not discouraging anybody from using these features, but if this server is a development server, you don't need load balancing, or you are using some other product for these goals, then use the Manager web app to Undeploy the are not going to use them, then balancer and host-manager web apps. In fact, I have no idea what the host-manager web app does, but everything runs fine without it. It would be great if the Tomcat team would give some clue about its purpose in the Tomcat documentation.