82
82
<p>The <em>Application Base</em> directory for this virtual host.
83
83
This is the pathname of a directory that may contain web applications
84
84
to be deployed on this virtual host. You may specify an
85
absolute pathname for this directory, or a pathname that is relative
86
to the <code>$CATALINA_BASE</code> directory. See
85
absolute pathname, or a pathname that is relative to the
86
<code>$CATALINA_BASE</code> directory. See
87
87
<a href="#Automatic Application Deployment">Automatic Application
88
88
Deployment</a> for more information on automatic recognition and
89
deployment of web applications to be deployed automatically. If not
90
specified, the default of <code>webapps</code> will be used.</p>
89
deployment of web applications. If not specified, the default of
90
<code>webapps</code> will be used.</p>
93
93
<attribute name="autoDeploy" required="false">
94
<p>This flag value indicates if new web applications, dropped in to
95
the <code>appBase</code> directory while Tomcat is running, should
96
be automatically deployed. The flag's value defaults to true. See
94
<p>This flag value indicates if Tomcat should check periodically for new
95
or updated web applications while Tomcat is running. If true, Tomcat
96
periodically checks the <code>appBase</code> and
97
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code>
98
directories and deploys any new web applications or context XML
99
descriptors found. Updated web applications or context XML descriptors
100
will trigger a reload of the web application. The flag's value defaults
97
102
<a href="#Automatic Application Deployment">Automatic Application
98
103
Deployment</a> for more information.</p>
156
161
<attribute name="deployXML" required="false">
157
<p>Set to <code>false</code> if you want to disable parsing the context.xml
158
file embedded inside the application (located at <code>/META-INF/context.xml</code>).
159
Security conscious environments should set this to <code>false</code> to prevent
160
applications from interacting with the container's configuration. The
161
administrator will then be responsible for providing an external context
162
configuration file, and put it in
163
<code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code>.
164
The flag's value defaults to <code>true</code>.</p>
162
<p>Set to <code>false</code> if you want to disable parsing the context
163
XML descriptor embedded inside the application (located at
164
<code>/META-INF/context.xml</code>). Security conscious environments
165
should set this to <code>false</code> to prevent applications from
166
interacting with the container's configuration. The administrator will
167
then be responsible for providing an external context configuration
168
file, and putting it in
169
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code>. The flag's
170
value defaults to <code>true</code>.</p>
167
173
<attribute name="errorReportValveClass" required="false">
277
284
started, if the <code>deployOnStartup</code> property is set to
278
285
<code>true</code> (which is the default value):</p>
280
<li>Any XML file in the
281
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> directory is
288
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> is
289
assumed to be a context XML descriptor containing a
283
290
<a href="context.html">Context</a> element (and its associated
284
subelements) for a single web application. The <code>docBase</code>
285
attribute of this <code><Context></code> element will typically
286
be the absolute pathname to a web application directory, or the
287
absolute pathname of a web application archive (WAR) file (which
288
will not be expanded). The path attribute will be automatically set
289
as defined in the <a href="context.html">Context</a> documentation.</li>
290
<li>Any web application archive file within the application base (appBase)
291
directory that does not have a corresponding
292
directory of the same name (without the ".war" extension) will be
293
automatically expanded, unless the <code>unpackWARs</code> property
294
is set to <code>false</code>. If you redeploy an updated WAR file,
295
be sure to delete the expanded directory when restarting Tomcat, so
296
that the updated WAR file will be re-expanded (note that the auto
297
deployer, if enabled, will automatically expand the updated WAR file
298
once the previously expanded directory is removed). Multi-level contexts
299
may be defined by using #, e.g. use a WAR named <code>foo#bar.war</code>
300
for a context path of <code>/foo/bar</code>.</li>
301
<li>Any subdirectory within the <em>application base directory</em>
302
will receive an automatically generated <a href="context.html">
303
Context</a> element, even if this directory is not mentioned in the
304
<code>conf/server.xml</code> file. The context path for this
305
deployed Context will be a slash character ("/") followed by the
306
directory name, unless the directory name is ROOT, in which case
307
the context path will be an empty string (""). Multi-level contexts
308
may be defined by using #, e.g. use a directory named <code>foo#bar</code>
309
for a context path of <code>/foo/bar</code>.</li>
291
sub-elements) for a single web application. The web applications
292
associated with each of these context XML descriptor files will be
294
The <code>docBase</code> attribute of this <code><Context></code>
295
element must only be set if the docBase is outside the Host's
296
<code>appBase</code>. For web applications located inside the Host's
297
<code>appBase</code>, the <code>docBase</code> will be the name of the
298
XML file with ".xml" replaced with ".war" for a web application archive
299
or the name of the XML file with ".xml" removed for a directory.<br/>
300
The <code>path</code> attribute must not be set. The context path used
301
will be a slash character ("/") followed by the name of the XML file
302
(less the .xml extension). Multi-level context paths may be defined
303
using #, e.g. <code>foo#bar.xml</code> for a context path of
304
<code>/foo/bar</code>. The default web application that has a context
305
path of <code>/</code> may be defined by using a file called
306
<code>ROOT.xml</code>.</li>
307
<li>Any web application archive file within the Host's <code>appBase</code>
308
directory that has not already been deployed as a result of a context
309
XML descriptor and does not have a corresponding directory of the same
310
name (without the ".war" extension) will be deployed next. The context
311
path used will be a slash character ("/") followed by the web
312
application archive name less the ".war" extension. The one exception to
313
this rule is that a web application archive named "ROOT.war" will be
314
deployed with a context path of <code>/</code>. Multi-level contexts may
315
be defined by using #, e.g. use a WAR named <code>foo#bar.war</code> for
316
a context path of <code>/foo/bar</code>.<br/>
317
If the <code>unpackWARs</code> attribute is <code>true</code>, the web
318
application archive file will be expanded to a directory of the same
319
name (without the ".war" extension".<br/>
320
Note: If you re-deploy an updated WAR file while Tomcat is stopped, be
321
sure to delete the associated expanded directory before restarting
322
Tomcat, so that the updated WAR file will be re-expanded when Tomcat
324
Any web application archive file within the Hosts's <code>appBase</code>
325
directory that does not have a corresponding context XML descriptor
326
(with a ".xml" extension rather than a ".war" extension) in
327
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> will be
328
scanned to see if it contains a context XML descriptor (located at
329
<code>/META-INF/context.xml</code>) and if one is found the descriptor
330
will be copied to the
331
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> directory and
334
<li>Finally, any sub-directory within the Host's <code>appBase</code> that
335
has not already been deployed as a result of a context XML descriptor
336
will be deployed. The context path used will be a slash character
337
("/") followed by the directory name, unless the directory name is ROOT,
338
in which case the context path will <code>/</code>. Multi-level contexts
339
may be defined by using #, e.g. use a directory named
340
<code>foo#bar</code> for a context path of <code>/foo/bar</code>.<br/>
341
Any directory within the Hosts's <code>appBase</code> directory that
342
does not have a corresponding context XML descriptor in
343
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> will be
344
scanned to see if it contains a context XML descriptor (located at
345
<code>/META-INF/context.xml</code>) and if one is found the descriptor
347
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> and renamed.
312
351
<p>In addition to the automatic deployment that occurs at startup time,
313
352
you can also request that new XML configuration files, WAR files, or
314
subdirectories that are dropped in to the <code>appBase</code> (or
353
sub-directories that are dropped in to the <code>appBase</code> (or
315
354
<code>$CATALINA_BASE/conf/[engine_name]/[host_name]</code> in the case of
316
355
an XML configuration file) directory while Tomcat is running will be
317
356
automatically deployed, according to the rules described above. The