Tomcat ships with a web application (by default installed at context
path /manager
) that facilitates installing, starting, stopping,
removing, listing information, and reloading (that is, forcing a reload of
all class files without removing the application from service) of other web
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 "install" command that prevents installing, removing, and then reinstalling an application from the same URL for a web application archive (WAR) file. To work around this, either reinstall the application from a different WAR file URL, or install 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.
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.path:status:sessions
. Where path is the context
path. Status is either running or stopped. Sessions is the number of
active Sessions./xxx
to reload all its
associated Java classes, even if automatic reloading is disabled./xxx
to be gracefully
shutdown and delete the web application directory and files./xxx
for this virtual host./xxx
for this
virtual host./xxx
for this
virtual host.Use path=/
for the ROOT context.
The syntax of the URL for a web application archive must conform to one of the following patterns to be successfully installed:
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.
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.