blob: 243dba1dea0708921b230727d88b51dfa49ef224 [file] [log] [blame]
Hongqing Liu71898292014-10-15 13:31:32 +08001<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 6.0 (6.0.41) - Tomcat Web Application Manager How To</title><meta name="author" content="Glenn L. Nielsen"><style type="text/css" media="print">
Hongqing Liufd5ee812014-05-10 16:32:51 +08002 .noPrint {display: none;}
3 td#mainBody {width: 100%;}
4 </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="./images/tomcat.gif" align="right" alt="
5 The Apache Tomcat Servlet/JSP Container
Hongqing Liu71898292014-10-15 13:31:32 +08006 " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1><font face="arial,helvetica,sanserif">Version 6.0.41, May 19 2014</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="nowrap" class="noPrint"><p><strong>Links</strong></p><ul><li><a href="index.html">Docs Home</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li></ul><p><strong>User Guide</strong></p><ul><li><a href="introduction.html">1) Introduction</a></li><li><a href="setup.html">2) Setup</a></li><li><a href="appdev/index.html">3) First webapp</a></li><li><a href="deployer-howto.html">4) Deployer</a></li><li><a href="manager-howto.html">5) Manager</a></li><li><a href="realm-howto.html">6) Realms and AAA</a></li><li><a href="security-manager-howto.html">7) Security Manager</a></li><li><a href="jndi-resources-howto.html">8) JNDI Resources</a></li><li><a href="jndi-datasource-examples-howto.html">9) JDBC DataSources</a></li><li><a href="class-loader-howto.html">10) Classloading</a></li><li><a href="jasper-howto.html">11) JSPs</a></li><li><a href="ssl-howto.html">12) SSL</a></li><li><a href="ssi-howto.html">13) SSI</a></li><li><a href="cgi-howto.html">14) CGI</a></li><li><a href="proxy-howto.html">15) Proxy Support</a></li><li><a href="mbeans-descriptor-howto.html">16) MBean Descriptor</a></li><li><a href="default-servlet.html">17) Default Servlet</a></li><li><a href="cluster-howto.html">18) Clustering</a></li><li><a href="balancer-howto.html">19) Load Balancer</a></li><li><a href="connectors.html">20) Connectors</a></li><li><a href="monitoring.html">21) Monitoring and Management</a></li><li><a href="logging.html">22) Logging</a></li><li><a href="apr.html">23) APR/Native</a></li><li><a href="virtual-hosting-howto.html">24) Virtual Hosting</a></li><li><a href="aio.html">25) Advanced IO</a></li><li><a href="extras.html">26) Additional Components</a></li><li><a href="maven-jars.html">27) Mavenized</a></li></ul><p><strong>Reference</strong></p><ul><li><a href="RELEASE-NOTES.txt">Release Notes</a></li><li><a href="config/index.html">Configuration</a></li><li><a href="api/index.html">Javadocs</a></li><li><a href="http://tomcat.apache.org/connectors-doc/">JK 1.2 Documentation</a></li></ul><p><strong>Apache Tomcat Development</strong></p><ul><li><a href="building.html">Building</a></li><li><a href="changelog.html">Changelog</a></li><li><a href="http://wiki.apache.org/tomcat/TomcatVersions">Status</a></li><li><a href="developers.html">Developers</a></li><li><a href="architecture/index.html">Architecture</a></li><li><a href="funcspecs/index.html">Functional Specs.</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Apache Tomcat 6.0</h1><h2>Tomcat Web Application Manager How To</h2><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
Hongqing Liufd5ee812014-05-10 16:32:51 +08007<ul><li><a href="#Introduction">Introduction</a></li><li><a href="#Message">Message</a></li><li><a href="#Manager">Manager</a></li><li><a href="#Applications">Applications</a><ol><li><a href="#Start">Start</a></li><li><a href="#Stop">Stop</a></li><li><a href="#Reload">Reload</a></li><li><a href="#Undeploy">Undeploy</a></li></ol></li><li><a href="#Deploy">Deploy</a><ol><li><a href="#Deploy_directory_or_WAR_file_located_on_server">Deploy directory or WAR file located on server</a></li><li><a href="#Upload_a_WAR_file_to_install">Upload a WAR file to install</a></li><li><a href="#Deployment_Notes">Deployment Notes</a></li><li><a href="#Deploy_Message">Deploy Message</a></li></ol></li><li><a href="#Diagnostics">Diagnostics</a><ol><li><a href="#Finding_memory_leaks">Finding memory leaks</a></li></ol></li><li><a href="#Server_Information">Server Information</a></li></ul>
8</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
9
10<p>In many production environments it is very useful to have the capability
11to manage your web applications without having to shut down and restart
12Tomcat. This document is for the HTML web interface to the web application
13<a href="manager-howto.html">manager</a>.</p>
14
15<p>The interface is divided into six sections:</p>
16<ul>
17 <li><strong>Message</strong> - Displays success and failure messages.</li>
18 <li><strong>Manager</strong> - General manager operations like list and
19 help.</li>
20 <li><strong>Applications</strong> - List of web applications and
21 commands.</li>
22 <li><strong>Deploy</strong> - Deploying web applications.</li>
23 <li><strong>Diagnostics</strong> - Identifying potential problems.</li>
24 <li><strong>Server Information</strong> - Information about the Tomcat
25 server.</li>
26</ul>
27
28</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Message"><strong>Message</strong></a></font></td></tr><tr><td><blockquote>
29
30<p>
31Displays information about the success or failure of the last web application
32manager command you performed. If it succeeded <strong>OK</strong> is displayed
33and may be followed by a success message. If it failed <strong>FAIL</strong>
34is displayed followed by an error message. Common failure messages are
35documented below for each command. The complete list of failure messages for
36each command can be found in the <a href="manager-howto.html">manager</a> web
37application documentation.
38</p>
39
40</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Manager"><strong>Manager</strong></a></font></td></tr><tr><td><blockquote>
41
42<p>The Manager section has three links:</p>
43<ul>
44 <li><strong>List Applications</strong> - Redisplay a list of web
45 applications.</li>
46 <li><strong>HTML Manager Help</strong> - A link to this document.</li>
47 <li><strong>Manager Help</strong> - A link to the comprehensive Manager
48 App HOW TO.</li>
49</ul>
50
51</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Applications"><strong>Applications</strong></a></font></td></tr><tr><td><blockquote>
52
53<p>The Applications section lists information about all the installed web
54applications and provides links for managing them. For each web application
55the following is displayed:</p>
56<ul>
57 <li><strong>Path</strong> - The web application context path.</li>
58 <li><strong>Display Name</strong> - The display name for the web application
59 if it has one configured in its "web.xml" file.</li>
60 <li><strong>Running</strong> - Whether the web application is running and
61 available (true), or not running and unavailable (false).</li>
62 <li><strong>Sessions</strong> - The number of active sessions for remote
63 users of this web application. The number of sessions is a link which
64 when submitted displays more details about session usage by the web
65 application in the Message box.</li>
66 <li><strong>Commands</strong> - Lists all commands which can be performed on
67 the web application. Only those commands which can be performed will be
68 listed as a link which can be submitted. No commands can be performed on
69 the manager web application itself. The following commands can be
70 performed:
71 <ul>
72 <li><strong>Start</strong> - Start a web application which had been
73 stopped.</li>
74 <li><strong>Stop</strong> - Stop a web application which is currently
75 running and make it unavailable.</li>
76 <li><strong>Reload</strong> - Reload the web application so that new
77 ".jar" files in <code>/WEB-INF/lib/</code> or new classes in
78 <code>/WEB-INF/classes/</code> can be used.</li>
79 <li><strong>Undeploy</strong> - Stop and then remove this web
80 application from the server.</li>
81 </ul>
82 </li>
83</ul>
84
85<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Start"><strong>Start</strong></a></font></td></tr><tr><td><blockquote>
86
87<p>Signal a stopped application to restart, and make itself available again.
88Stopping and starting is useful, for example, if the database required by
89your application becomes temporarily unavailable. It is usually better to
90stop the web application that relies on this database rather than letting
91users continuously encounter database exceptions.</p>
92
93<p>If this command succeeds, you will see a Message like this:</p>
94<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
95OK - Started application at context path /examples
96</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
97
98<p>Otherwise, the Message will start with <code>FAIL</code> and include an
99error message. Possible causes for problems include:</p>
100<ul>
101<li><em>Encountered exception</em>
102 <blockquote>
103 <p>An exception was encountered trying to start the web application.
104 Check the Tomcat 6 logs for the details.</p>
105 </blockquote></li>
106<li><em>Invalid context path was specified</em>
107 <blockquote>
108 <p>The context path must start with a slash character, unless you are
109 referencing the ROOT web application -- in which case the context path
110 must be a zero-length string.</p>
111 </blockquote></li>
112<li><em>No context exists for path /foo</em>
113 <blockquote>
114 <p>There is no deployed application on the context path
115 that you specified.</p>
116 </blockquote></li>
117<li><em>No context path was specified</em>
118 <blockquote>
119 The <code>path</code> parameter is required.
120 </blockquote></li>
121</ul>
122
123</blockquote></td></tr></table>
124
125<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Stop"><strong>Stop</strong></a></font></td></tr><tr><td><blockquote>
126
127<p>Signal an existing application to make itself unavailable, but leave it
128deployed. Any request that comes in while an application is
129stopped will see an HTTP error 404, and this application will show as
130"stopped" on a list applications command.</p>
131
132<p>If this command succeeds, you will see a Message like this:</p>
133<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
134OK - Stopped application at context path /examples
135</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
136
137<p>Otherwise, the Message will start with <code>FAIL</code> and include an
138error message. Possible causes for problems include:</p>
139<ul>
140<li><em>Encountered exception</em>
141 <blockquote>
142 <p>An exception was encountered trying to stop the web application.
143 Check the Tomcat 6 logs for the details.</p>
144 </blockquote></li>
145<li><em>Invalid context path was specified</em>
146 <blockquote>
147 <p>The context path must start with a slash character, unless you are
148 referencing the ROOT web application -- in which case the context path
149 must be a zero-length string.</p>
150 </blockquote></li>
151<li><em>No context exists for path /foo</em>
152 <blockquote>
153 <p>There is no deployed application on the context path
154 that you specified.</p>
155 </blockquote></li>
156<li><em>No context path was specified</em>
157 <blockquote>
158 The <code>path</code> parameter is required.
159 </blockquote></li>
160</ul>
161
162</blockquote></td></tr></table>
163
164<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Reload"><strong>Reload</strong></a></font></td></tr><tr><td><blockquote>
165
166<p>Signal an existing application to shut itself down and reload. This can
167be useful when the web application context is not reloadable and you have
168updated classes or property files in the <code>/WEB-INF/classes</code>
169directory or when you have added or updated jar files in the
170<code>/WEB-INF/lib</code> directory.
171</p>
172<p><strong>NOTE:</strong> The <code>/WEB-INF/web.xml</code>
173web application configuration file is not checked on a reload;
174the previous web.xml configuration is used.
175If you have made changes to your web.xml file you must stop
176then start the web application.
177</p>
178
179<p>If this command succeeds, you will see a Message like this:</p>
180<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
181OK - Reloaded application at context path /examples
182</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
183
184<p>Otherwise, the Message will start with <code>FAIL</code> and include an
185error message. Possible causes for problems include:</p>
186<ul>
187<li><em>Encountered exception</em>
188 <blockquote>
189 <p>An exception was encountered trying to restart the web application.
190 Check the Tomcat 6 logs for the details.</p>
191 </blockquote></li>
192<li><em>Invalid context path was specified</em>
193 <blockquote>
194 <p>The context path must start with a slash character, unless you are
195 referencing the ROOT web application -- in which case the context path
196 must be a zero-length string.</p>
197 </blockquote></li>
198<li><em>No context exists for path /foo</em>
199 <blockquote>
200 <p>There is no deployed application on the context path
201 that you specified.</p>
202 </blockquote></li>
203<li><em>No context path was specified</em>
204 <blockquote>
205 The <code>path</code> parameter is required.
206 </blockquote></li>
207<li><em>Reload not supported on WAR deployed at path /foo</em>
208 <blockquote>
209 Currently, application reloading (to pick up changes to the classes or
210 <code>web.xml</code> file) is not supported when a web application is
211 installed directly from a WAR file, which happens when the host is
212 configured to not unpack WAR files. As it only works when the web
213 application is installed from an unpacked directory, if you are using
214 a WAR file, you should <code>undeploy</code> and then <code>deploy</code>
215 the application again to pick up your changes.
216 </blockquote></li>
217</ul>
218
219</blockquote></td></tr></table>
220
221<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Undeploy"><strong>Undeploy</strong></a></font></td></tr><tr><td><blockquote>
222
223<p><strong><font color="red">WARNING</font> - This command will delete the
224contents of the web application directory and/or ".war" file if it exists within
225the <code>appBase</code> directory (typically "webapps") for this virtual host
226</strong>. The web application temporary work directory is also deleted. If
227you simply want to take an application out of service, you should use the
228<code>/stop</code> command instead.</p>
229
230<p>Signal an existing application to gracefully shut itself down, and then
231remove it from Tomcat (which also makes this context path available for
232reuse later). This command is the logical opposite of the
233<code>/deploy</code> Ant command, and the related deploy features available
234in the HTML manager.</p>
235
236<p>If this command succeeds, you will see a Message like this:</p>
237<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
238OK - Undeployed application at context path /examples
239</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
240
241<p>Otherwise, the Message will start with <code>FAIL</code> and include an
242error message. Possible causes for problems include:</p>
243<ul>
244<li><em>Encountered exception</em>
245 <blockquote>
246 <p>An exception was encountered trying to undeploy the web application.
247 Check the Tomcat logs for the details.</p>
248 </blockquote></li>
249<li><em>Invalid context path was specified</em>
250 <blockquote>
251 <p>The context path must start with a slash character, unless you are
252 referencing the ROOT web application -- in which case the context path
253 must be a zero-length string.</p>
254 </blockquote></li>
255<li><em>No context exists for path /foo</em>
256 <blockquote>
257 <p>There is no deployed application on the context path
258 that you specified.</p>
259 </blockquote></li>
260<li><em>No context path was specified</em>
261 <blockquote>
262 The <code>path</code> parameter is required.
263 </blockquote></li>
264</ul>
265
266</blockquote></td></tr></table>
267
268</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deploy"><strong>Deploy</strong></a></font></td></tr><tr><td><blockquote>
269
270<p>Web applications can be deployed using files or directories located
271on the Tomcat server or you can upload a web application archive (WAR)
272file to the server.</p>
273
274<p>To install an application, fill in the appropriate fields for the type
275of install you want to do and then submit it using the <i>Install</i>
276button.</p>
277
278<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deploy directory or WAR file located on server"><!--()--></a><a name="Deploy_directory_or_WAR_file_located_on_server"><strong>Deploy directory or WAR file located on server</strong></a></font></td></tr><tr><td><blockquote>
279
280<p>Deploy and start a new web application, attached to the specified <i>Context
281Path:</i> (which must not be in use by any other web application).
282This command is the logical opposite of the <em>Undeploy</em> command.</p>
283
284<p>There are a number of different ways the deploy command can be used.</p>
285
286<h3>Deploy a Directory or WAR by URL</h3>
287
288<p>Install a web application directory or ".war" file located on the Tomcat
289server. If no <i>Context Path</i> is specified, the directory name or the
290war file name without the ".war" extension is used as the path. The
291<i>WAR or Directory URL</i> specifies a URL (including the <code>file:</code>
292scheme) for either a directory or a web application archive (WAR) file. The
293supported syntax for a URL referring to a WAR file is described on the Javadocs
294page for the <code>java.net.JarURLConnection</code> class. Use only URLs that
295refer to the entire WAR file.</p>
296
297<p>In this example the web application located in the directory
298<code>C:\path\to\foo</code> on the Tomcat server (running on Windows)
299is deployed as the web application context named <code>/footoo</code>.</p>
300<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
301Context Path: /footoo
302WAR or Directory URL: file:C:/path/to/foo
303</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
304
305
306<p>In this example the ".war" file <code>/path/to/bar.war</code> on the
307Tomcat server (running on Unix) is deployed as the web application
308context named <code>/bar</code>. Notice that there is no <code>path</code>
309parameter so the context path defaults to the name of the web application
310archive file without the ".war" extension.</p>
311<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
312WAR or Directory URL: jar:file:/path/to/bar.war!/
313</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
314
315
316<h3>Deploy a Directory or War from the Host appBase</h3>
317
318<p>Install a web application directory or ".war" file located in your Host
319appBase directory. If no <i>Context Path</i> is specified the directory name
320or the war file name without the ".war" extension is used as the path.</p>
321
322<p>In this example the web application located in a subdirectory named
323<code>foo</code> in the Host appBase directory of the Tomcat server is
324deployed as the web application context named <code>/foo</code>. Notice
325that there is no <code>path</code> parameter so the context path defaults
326to the name of the web application directory.</p>
327<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
328WAR or Directory URL: foo
329</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
330
331
332<p>In this example the ".war" file <code>bar.war</code> located in your
333Host appBase directory on the Tomcat server is deployed as the web
334application context named <code>/bartoo</code>.</p>
335<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
336Context Path: /bartoo
337WAR or Directory URL: bar.war
338</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
339
340
341<h3>Deploy using a Context configuration ".xml" file</h3>
342
343<p>If the Host deployXML flag is set to true, you can install a web
344application using a Context configuration ".xml" file and an optional
345".war" file or web application directory. The <i>Context Path</i>
346is not used when installing a web application using a context ".xml"
347configuration file.</p>
348
349<p>A Context configuration ".xml" file can contain valid XML for a
350web application Context just as if it were configured in your
351Tomcat <code>server.xml</code> configuration file. Here is an
352example for Tomcat running on Windows:</p>
353<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
354&lt;Context path="/foobar" docBase="C:\path\to\application\foobar"&gt;
355
356 &lt;!-- Link to the user database we will get roles from --&gt;
357 &lt;ResourceLink name="users" global="UserDatabase"
358 type="org.apache.catalina.UserDatabase"/&gt;
359
360&lt;/Context&gt;
361</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
362
363
364<p>Use of the <i>WAR or Directory URL</i> is optional. When used
365to select a web application ".war" file or directory it overrides any
366docBase configured in the context configuration ".xml" file.</p>
367
368<p>Here is an example of installing an application using a Context
369configuration ".xml" file for Tomcat running on Windows.</p>
370<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
371XML Configuration file URL: file:C:/path/to/context.xml
372</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
373
374
375<p>Here is an example of installing an application using a Context
376configuration ".xml" file and a web application ".war" file located
377on the server (Tomcat running on Unix).</p>
378<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
379XML Configuration file URL: file:/path/to/context.xml
380WAR or Directory URL: jar:file:/path/to/bar.war!/
381</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
382
383
384</blockquote></td></tr></table>
385
386<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Upload a WAR file to install"><!--()--></a><a name="Upload_a_WAR_file_to_install"><strong>Upload a WAR file to install</strong></a></font></td></tr><tr><td><blockquote>
387
388<p>Upload a WAR file from your local system and install it into the
389appBase for your Host. The name of the WAR file without the ".war"
390extension is used as the context path name.</p>
391
392<p>Use the <i>Browse</i> button to select a WAR file to upload to the
393server from your local desktop system.</p>
394
395<p>The .WAR file may include Tomcat specific deployment configuration, by
396including a Context configuration XML file in
397<code>/META-INF/context.xml</code>.</p>
398
399<p>Upload of a WAR file could fail for the following reasons:</p>
400<ul>
401<li><em>File uploaded must be a .war</em>
402 <blockquote>
403 <p>The upload install will only accept files which have the filename
404 extension of ".war".</p>
405 </blockquote></li>
406<li><em>War file already exists on server</em>
407 <blockquote>
408 <p>If a war file of the same name already exists in your Host's
409 appBase the upload will fail. Either undeploy the existing war file
410 from your Host's appBase or upload the new war file using a different
411 name.</p>
412 </blockquote></li>
413<li><em>File upload failed, no file</em>
414 <blockquote>
415 <p>The file upload failed, no file was received by the server.</p>
416 </blockquote></li>
417<li><em>Install Upload Failed, Exception:</em>
418 <blockquote>
419 <p>The war file upload or install failed with a Java Exception.
420 The exception message will be listed.</p>
421 </blockquote></li>
422</ul>
423
424</blockquote></td></tr></table>
425
426<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deployment Notes"><!--()--></a><a name="Deployment_Notes"><strong>Deployment Notes</strong></a></font></td></tr><tr><td><blockquote>
427
428<p>If the Host is configured with unpackWARs=true and you install a war
429file, the war will be unpacked into a directory in your Host appBase
430directory.</p>
431
432<p>If the application war or directory is deployed in your Host appBase
433directory and either the Host is configured with autoDeploy=true or
434liveDeploy=true, the Context path must match the directory name or
435war file name without the ".war" extension.</p>
436
437<p>For security when untrusted users can manage web applications, the
438Host deployXML flag can be set to false. This prevents untrusted users
439from installing web applications using a configuration XML file and
440also prevents them from installing application directories or ".war"
441files located outside of their Host appBase.</p>
442
443</blockquote></td></tr></table>
444
445<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deploy Message"><!--()--></a><a name="Deploy_Message"><strong>Deploy Message</strong></a></font></td></tr><tr><td><blockquote>
446
447<p>If deployment and startup is successful, you will receive a Message
448like this:</p>
449<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
450OK - Deployed application at context path /foo
451</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
452
453<p>Otherwise, the Message will start with <code>FAIL</code> and include an
454error message. Possible causes for problems include:</p>
455<ul>
456<li><em>Application already exists at path /foo</em>
457 <blockquote>
458 <p>The context paths for all currently running web applications must be
459 unique. Therefore, you must either undeploy the existing web
460 application using this context path, or choose a different context path
461 for the new one.</p>
462 </blockquote></li>
463<li><em>Document base does not exist or is not a readable directory</em>
464 <blockquote>
465 <p>The URL specified by the <i>WAR or Directory URL:</i> field must
466 identify a directory on this server that contains the "unpacked" version
467 of a web application, or the absolute URL of a web application archive
468 (WAR) file that contains this application. Correct the value entered for
469 the <i>WAR or Directory URL:</i> field.</p>
470 </blockquote></li>
471<li><em>Encountered exception</em>
472 <blockquote>
473 <p>An exception was encountered trying to start the new web application.
474 Check the Tomcat 6 logs for the details, but likely explanations include
475 problems parsing your <code>/WEB-INF/web.xml</code> file, or missing
476 classes encountered when initializing application event listeners and
477 filters.</p>
478 </blockquote></li>
479<li><em>Invalid application URL was specified</em>
480 <blockquote>
481 <p>The URL for the <i>WAR or Directory URL:</i> field that you specified
482 was not valid. Such URLs must start with <code>file:</code>, and URLs
483 for a WAR file must end in ".war".</p>
484 </blockquote></li>
485<li><em>Invalid context path was specified</em>
486 <blockquote>
487 <p>The context path must start with a slash character, unless you are
488 referencing the ROOT web application -- in which case the context path
489 must be a "/" string.</p>
490 </blockquote></li>
491<li><em>Context path must match the directory or WAR file name:</em>
492 <blockquote>
493 If the application war or directory is deployed in your Host appBase
494 directory and either the Host is configured with autoDeploy=true or
495 liveDeploy=true, the Context path must match the directory name or
496 war file name without the ".war" extension.
497 </blockquote></li>
498<li><em>Only web applications in the Host web application directory can
499 be deployed</em>
500 <blockquote>
501 If the Host deployXML flag is set to false this error will happen
502 if an attempt is made to install a web application directory or
503 ".war" file outside of the Host appBase directory.
504 </blockquote></li>
505</ul>
506
507</blockquote></td></tr></table>
508</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Diagnostics"><strong>Diagnostics</strong></a></font></td></tr><tr><td><blockquote>
509
510<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Finding memory leaks"><!--()--></a><a name="Finding_memory_leaks"><strong>Finding memory leaks</strong></a></font></td></tr><tr><td><blockquote>
511
512<p><strong>The find leaks diagnostic triggers a full garbage collection. It
513should be used with extreme caution on production systems.</strong></p>
514
515<p>The find leaks diagnostic attempts to identify web applications that have
516caused memory leaks when they were stopped, reloaded or undeployed. Results
517should always be confirmed
518with a profiler. The diagnostic uses additional functionality provided by the
519StandardHost implementation. It will not work if a custom host is used that
520does not extend StandardHost.</p>
521
522<p>This diagnostic will list context paths for the web applications that were
523stopped, reloaded or undeployed, but which classes from the previous runs
524are still present in memory, thus being a memory leak. If an application
525has been reloaded several times, it may be listed several times.</p>
526
527<p>Explicitly triggering a full garbage collection from Java code is documented
528to be unreliable. Furthermore, depending on the JVM used, there are options to
529disable explicit GC triggering, like <code>-XX:+DisableExplicitGC</code>.
530If you want to make sure, that the diagnostics were successfully running a full GC,
531you will need to check using tools like GC logging, JConsole or similar.</p>
532
533</blockquote></td></tr></table>
534</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Server Information"><!--()--></a><a name="Server_Information"><strong>Server Information</strong></a></font></td></tr><tr><td><blockquote>
535
536<p>This section displays information about Tomcat, the operating system of
537the server Tomcat is hosted on, and the Java Virtual Machine Tomcat is
538running in.</p>
539
540</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
541 Copyright &copy; 1999-2014, Apache Software Foundation
542 </em></font></div></td></tr></table></body></html>