All,
Attached is a zip archive containing a set of task defs that can be used to interact with the manager webapp that comes with Jakarta-Tomcat 4.0. Included in the zip are the source files, build.xml, compiled jar, and user manual. Attached seperately is the "user manual" page similar to other optional tasks that come with Ant. I know that these are not very complex taskdefs, but I wanted to contribute them anyway. The apache license is included in all of the source files. Bree (See attached file: tomcatTaskdefs.zip)(See attached file: tomcatmanager.html)
<<attachment: tomcatTaskdefs.zip>>
Title: Ant Tomcat Manager TasksTomcat 4.0 Manager Tasks User Manual
by
- Bree VanOss([EMAIL PROTECTED])
Version 0.1
$Id: tomcatmanager.html,v 10.1 2001/10/05 09:31:23 vanoss Exp $
Table of Contents
Introduction
The Tomcat 4.0 Manager Tasks are used to interact with the manager
webapp that comes with Tomcat 4.0.
<snip doc="tomcat manager app how to">
In many production environments, it is very useful to have the capability to deploy a new web application, or undeploy an existing one, without having to shut down and restart the entire container. In addition, you can request an existing application to reload itself, even if you have not declared it to be reloadable in the Tomcat 4 server configuration file.
Since Manager is itself a web application, it interacts with you using standard HTTP requests and responses. However, it's "user interface" is minimal, because it is intended to be accessed from scripts set up by the system administrator. For this reason, commands are given as part of the request URI, and responses are in the form of simple text that can be easily parsed and processed.
</snip>
The following tasks are supported.
- Deploy a new web application, on a specified context path, from a specified directory or WAR file pathname.
- List the currently deployed web applications, as well as the sessions that are currently active for those web apps.
- Cause an existing application to be reloaded.
- Undeploy an existing web application.
- Stop an existing application (so that it becomes unavailable), but do not undeploy it.
- Start a stopped application (thus making it available again).
Tomcat Tasks
| Task | Description | |
| tomcatdeploy | Deploy a new web application, on a specified context path, from a specified directory or WAR file pathname. | |
| tomcatundeploy | Undeploy an existing web application. | |
| tomcatlist | List the currently deployed web applications, as well as the sessions that are currently active for those web apps. | |
| tomcatreload | Cause an existing application to be reloaded. | |
| tomcatsessionstats | Display the timeout info for a particular web application. | |
| tomcatstartwebapp | Start a stopped application (thus making it available again). | |
| tomcatstopwebapp | Stop an existing application (so that it becomes unavailable), but do not undeploy it. | |
tomcatdeploy
Description:
Deploy a new web application, on a specified context path, from a specified directory or WAR file pathname.
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
| path | Path to the web application that is to be deployed | Yes |
| warfile | Path to the war that contains the web application to be deployed.* | No |
| fileroot | Path to the directory location of the web application to be deployed.* | No |
Examples
<tomcatdeploywebapp username="bree"
password="tomcat"
host="http://localhost"
port="8080"
path="/${appname}"
warfile="D:\code\paddlenorthflorida\assemble\paddlenorthflorida.war"
/>
tomcatundeploy
Description:
Undeploy an existing web application.
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
| path | Path to the web application that is to be undeployed | Yes |
Examples
<tomcatundeploywebapp username="bree"
password="tomcat"
host="http://localhost"
port="8080"
path="/${appname}"
/>
tomcatlist
Description:
List the currently deployed web applications, as well as the sessions that are currently active for those web apps.
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
Examples
<tomcatlist username="bree"
password="tomcat"
host="http://localhost"
port="8080"
/>
tomcatreload
Description:
Cause an existing application to be reloaded.
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
| path | Path to the web application that is to be reloaded | Yes |
Examples
<tomcatreload username="bree"
password="tomcat"
host="http://localhost"
port="8080"
path="/${appname}"
/>
tomcatsessionstats
Description:
Display the timeout info for a particular web application.
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
Examples
<tomcatsessionstats username="bree"
password="tomcat"
host="http://localhost"
port="8080"
/>
tomcatstartwebapp
Description:
Start a stopped application (thus making it available again).
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
| path | Path to the web application that is to be started | Yes |
Examples
<tomcatstartwebapp username="bree"
password="tomcat"
host="http://localhost"
port="8080"
path="/${appname}"
/>
tomcatstopwebapp
Description:
Stop an existing application (so that it becomes unavailable), but do not undeploy it.
Parameters:
| Attribute | Description | Required |
| username | Username that has the manager role. | Yes |
| password | Password. | Yes |
| host | Host where tomcat is deployed. | Yes |
| port | Port tomcat is listening on. Port 8080 is used if no port is specified. | No |
| path | Path to the web application that is to be stoped. | Yes |
Examples
<tomcatstopwebapp username="bree"
password="tomcat"
host="http://localhost"
port="8080"
path="/${appname}"
/>
