📄 manual.html
字号:
</p>
<ul>
<li>Deployment of .WAR files copied into the Host <code>appBase</code>.</li>
<li>
Deployment of exploded web applications which are
copied into the Host <code>appBase</code>.
</li>
<li>
Re-deployment of a web application which has already been deployed from
a .WAR when the new .WAR is provided. In this case the exploded
web application is removed, and the .WAR is expanded again.
Note that the explosion will not occur if the Host is configured
so that .WARs are not exploded with a <code>unpackWARs</code>
attribute set to "false", in which case the web application
will be simply redeployed as a compressed archive.
</li>
<li>
Re-deployment of a web application if the /WEB-INF/web.xml file (or any
other resource defined as a WatchedResource) is updated.
</li>
<li>
Re-deployment of a web application if the Context Descriptor file from which
the web application has been deployed is updated.
</li>
<li>
Re-deployment of a web application if a Context Descriptor file (with a
filename corresponding to the Context path of the previously deployed
web application) is added to the
<code>$CATALINA_HOME/conf/[enginename]/[hostname]/</code>
directory.
</li>
<li>
Undeployment of a web application if its document base (docBase)
is deleted. Note that on Windows, this assumes that anti-locking
features (see Context configuration) are enabled, otherwise it is not
possible to delete the resources of a running web application.
</li>
</ul>
<p>
Note that web application reloading can also be configured in the loader, in which
case loaded classes will be tracked for changes.
</p>
</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Deploying using the Tomcat Manager"><strong>Deploying using the Tomcat Manager</strong></a></font></td></tr><tr><td><blockquote>
<p>
The Tomcat Manager is covered in its <a href="manager-howto.html">own manual page</a>.
</p>
</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Deploying using the Client Deployer Package"><strong>Deploying using the Client Deployer Package</strong></a></font></td></tr><tr><td><blockquote>
<p>
Finally, deployment of web application may be achieved using the
Tomcat Client Deployer. This is a package which can be used to
validate, compile, compress to .WAR, and deploy web applications to
production or development Tomcat servers. It should be noted that this feature
uses the Tomcat Manager and as such the target Tomcat server should be
running.
</p>
<p>
It is assumed the user will be familar with Apache Ant for using the TCD.
Apache Ant is a scripted build tool. The TCD comes pre-packaged with a
build script to use. Only a modest understanding of Apache Ant is
required (installation as listed earlier in this page, and familiarity
with using the operating system command shell and configuring
environment variables).
</p>
<p>
The TCD includes Ant tasks, the Jasper page compiler for JSP compilation
before deployment, as well as a task which
validates the web application Context Descriptor. The validator task (class
<code>org.apache.catalina.ant.ValidatorTask</code>) allows only one parameter:
the base path of an exploded web application.
</p>
<p>
The TCD uses an exploded web application as input (see the list of the
properties used below). A web application that is programatically
deployed with the deployer may include a Context Desciptor in
<code>/META-INF/context.xml</code>.
</p>
<p>
The TCD includes a ready-to-use Ant script, with the following targets:
</p>
<ul>
<li>
<code>compile</code> (default): Compile and validate the web
application. This can be used standalone, and does not need a running
Tomcat server. The compiled application will only run on the associated
Tomcat 5.5.x server release, and is not guaranteed to work on another
Tomcat release, as the code generated by Jasper depends on its runtime
component. It should also be noted that this target will also compile
automatically any Java source file located in the
<code>/WEB-INF/classes</code> folder of the web application.</li>
<li>
<code>deploy</code>: Deploy a web application (compiled or not) to
a Tomcat server.
</li>
<li><code>undeploy</code>: Undeploy a web application</li>
<li><code>start</code>: Start web application</li>
<li><code>reload</code>: Reload web application</li>
<li><code>stop</code>: Stop web application</li>
</ul>
<p>
In order for the deployment to be configured, create a file
called <code>deployer.properties</code> in the TCD installation
directory root. In this file, add the following name=value pairs per
line:
</p>
<p>
Additionally, you will need to ensure that a user has been
setup for the target Tomcat Manager (which TCD uses) otherwise the TCD
will not authenticate with the Tomcat Manager and the deployment will
fail. To do this, see the Tomcat Manager page.
</p>
<ul>
<li>
<code>build</code>: The build folder used will be, by default,
<code>${build}/webapp/${path}</code>. After the end of the execution
of the <code>compile</code> target, the web application .WAR will be
located at <code>${build}/webapp/${path}.war</code>.
</li>
<li>
<code>webapp</code>: The directory containing the exploded web application
which will be compiled and validated. By default, the folder is
<code>myapp</code>.
</li>
<li>
<code>path</code>: Deployed context path of the web application,
by default <code>/myapp</code>.
</li>
<li>
<code>url</code>: Absolute URL to the Tomcat Manager web application of a
running Tomcat server, which will be used to deploy and undeploy the
web application. By default, the deployer will attempt to access
a Tomcat instance running on localhost, at
<code>http://localhost:8080/manager</code>.
</li>
<li>
<code>username</code>: Tomcat Manager username (user should have a role of
manager)
</li>
<li><code>password</code>: Tomcat Manager password.</li>
</ul>
</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade="noshade"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em>
Copyright © 1999-2008, Apache Software Foundation
</em></font></div></td></tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -