To manage web applications with Tomcat, you can use the Tomcat manager application that comes with Tomcat. These simple steps show how it is done:
- Make sure that there is a user with manager role set up in the
.../tomcat4/conf/tomcat-users.xmlfile. The line to define the user should look like this:<user username="manager" password="md5hash-goes-here" roles="admin,manager">
- If you changed the file above, restart tomcat, for your changes to take effect.
- Now you are ready to use the Tomcat manager webapp to load / reload / unload webapps from your tomcat container.
- Refer to the tomcat manager webapp documentation for all the details. Here are a couple of examples:
- To list the loaded apps, and their status:
http://localhost:[port]/manager/list
- To reload an app (“[port]” is your HTTP connector port in the server.xml file, and “[webapp-path]” is the path as displayed with the “list” comand):
http://localhost:[port]/manager/reload?path=/[webapp-path]
- To list the loaded apps, and their status:
- Since the HTTP connector is usually not available from outside the firewall, you will probably do that from the command line, in which case, the most effective way is to use “curl” eg:
curl -u [admin_user]:[secret_passwd] http://localhost:[port]/manager/reload?path=/[webapp-path]