[ Team LiB ] Previous Section Next Section

Tomcat Manager

The Tomcat distribution also includes a Manager application that will deploy WAR files from any location. Like the Administration tool, the Manager is available from the default Tomcat home page. Click the link that reads "Tomcat Manager." Figure A.4 shows the initial screen.

Figure A.4. The Tomcat Manager helps deploy applications.

graphics/ap01fig04.jpg

With the Tomcat Manager, you can deploy, start, stop, and undeploy Web applications.

Adding Administrators and Managers

graphics/didyouknow_icon.gif

By default, Tomcat may not provide a user that is authorized to use the Administration Tool or Manager. Although the Windows Installer version creates a user in the proper roles, other versions do not. You'll need to add a user with sufficient privileges or add the roles of admin and manager to an existing user. Edit the tomcat-users.xml file in conf to look like this:


<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="admin" password="password" roles="admin,manager"/>
</tomcat-users>

Complete instructions can be found at

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html


As you already know from working through the examples in the book, Tomcat also recognizes WAR files if you place them in webapps. When you restart Tomcat, it automatically unpacks any new WAR files. If you need to update a WAR file, however, you must delete the directory that Tomcat creates.

For example, if you copy a file named tagdemo.war into the webapps directory, Tomcat creates a directory named tagdemo the next time it starts and unpacks the contents of tagdemo.war into the directory. If you want to install a new tagdemo.war, make sure you remove the tagdemo directory.

    [ Team LiB ] Previous Section Next Section