Tomcat 4.0 ships with a web application (by default installed at context
path /manager
) that facilitates deploying, undeploying, and
reloading (that is, forcing a reload of all class files without removing the
application from service) of other applications that are running in the same
virtual host as the Manager application itself. This application is suited
to scripted operation, because it can be executed from any client program that
can issue HTTP requests. As such, it is complementary to other administrative
applications that have a more human-oriented user interface.
WARNING - As of the Tomcat 4.0 milestone 2 release, there is a bug in the operation of the "deploy" command that prevents deploying, undeploying, and then redeploying an application from the same URL for a web application archive (WAR) file. To work around this, either redeploy the application from a different WAR file URL, or deploy from an unpacked directory (on the same server that Tomcat is running on).
The Manager application servlet responds to action requests that are encoded
as the extra path information, and request parameters, of HTTP requests made to
the manager application. The following command descriptions assume that you
have installed the Manager application on context path /manager
on your local host installation of Tomcat 4.0.
yyy
, and attach it
to context path /xxx
. See below for valid syntax options
for the web applcation archive URl. If the URL of an actual WAR file
is specified, the WAR will be automatically expanded into a directory
underneath the application base for this virtual host./xxx
to reload all its
associated Java classes, even if automatic reloading is disabled./xxx
to be gracefully
shut down and undeployed. If a WAR file was automatically expanded into
an unpacked directory when this application was deployed (or when the
servlet container was first started), the expanded directory is deleted.
The syntax of the URL for a web application archive must conform to one of the following patterns to be successfully deployed:
JarURLConnection
class for a
reference to an entire JAR file.JarURLConnection
class for a reference to an entire
JAR file.For ease of script processing, the response generated by the Manager
application servlet is rendered with content type text/plain
.
The first line of the response starts with "OK - " or "FAIL - " depending
on whether the requested operation was successful or not, followed by a
descriptive summary of the operation that took place, or the error that
prevented the requested operation from taking place. If the /list
operation was requested, this line is followed by a list of the context paths
of all deployed web applcations in this virtual host, one per line.
Obviously, the Manager application can have significant impacts on a running instance of Tomcat. Therefore, it should not be (and is not) enabled by default. The following security considerations apply to this application.
manager
. There
are no such users in the default
$CATALINA_HOME/conf/tomcat-users.xml
file, so by default no
one can execute any of the commands supported by the Manager application.
/servlet/org.apache.catalina.servlets.ManagerServlet
). You
MUST install a <servlet-mapping>
element in a web application deployment descriptor (or use the default
web application shipped with Tomcat) to use this functionality.
Authorization
header they
should send, once the assigned username and password are known.