blob: b18a4ff0b3c10d90c03d50e35e4c395830d8abd7 [file] [log] [blame]
刘洪青6266f992017-05-15 21:21:03 +08001<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 7 (7.0.77) - Tomcat Web Application Deployment</title><meta name="author" content="Allistair Crossley"><style type="text/css" media="print">
2 .noPrint {display: none;}
3 td#mainBody {width: 100%;}
4</style><style type="text/css">
5code {background-color:rgb(224,255,255);padding:0 0.1em;}
6code.attributeName, code.propertyName {background-color:transparent;}
7
8
9table {
10 border-collapse: collapse;
11 text-align: left;
12}
13table *:not(table) {
14 /* Prevent border-collapsing for table child elements like <div> */
15 border-collapse: separate;
16}
17
18th {
19 text-align: left;
20}
21
22
23div.codeBox pre code, code.attributeName, code.propertyName, code.noHighlight, .noHighlight code {
24 background-color: transparent;
25}
26div.codeBox {
27 overflow: auto;
28 margin: 1em 0;
29}
30div.codeBox pre {
31 margin: 0;
32 padding: 4px;
33 border: 1px solid #999;
34 border-radius: 5px;
35 background-color: #eff8ff;
36 display: table; /* To prevent <pre>s from taking the complete available width. */
37 /*
38 When it is officially supported, use the following CSS instead of display: table
39 to prevent big <pre>s from exceeding the browser window:
40 max-width: available;
41 width: min-content;
42 */
43}
44
45div.codeBox pre.wrap {
46 white-space: pre-wrap;
47}
48
49
50table.defaultTable tr, table.detail-table tr {
51 border: 1px solid #CCC;
52}
53
54table.defaultTable tr:nth-child(even), table.detail-table tr:nth-child(even) {
55 background-color: #FAFBFF;
56}
57
58table.defaultTable tr:nth-child(odd), table.detail-table tr:nth-child(odd) {
59 background-color: #EEEFFF;
60}
61
62table.defaultTable th, table.detail-table th {
63 background-color: #88b;
64 color: #fff;
65}
66
67table.defaultTable th, table.defaultTable td, table.detail-table th, table.detail-table td {
68 padding: 5px 8px;
69}
70
71
72p.notice {
73 border: 1px solid rgb(255, 0, 0);
74 background-color: rgb(238, 238, 238);
75 color: rgb(0, 51, 102);
76 padding: 0.5em;
77 margin: 1em 2em 1em 1em;
78}
79</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="
Hongqing Liufd5ee812014-05-10 16:32:51 +080080 The Apache Tomcat Servlet/JSP Container
刘洪青6266f992017-05-15 21:21:03 +080081 " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 7</font></h1><font face="arial,helvetica,sanserif">Version 7.0.77, Mar 28 2017</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.svg" align="right" alt="Apache Logo" border="0" style="width: 266px;height: 83px;"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" 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><li><a href="#comments_section">User Comments</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/TLS</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-descriptors-howto.html">16) MBeans Descriptors</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><li><a href="security-howto.html">28) Security Considerations</a></li><li><a href="windows-service-howto.html">29) Windows Service</a></li><li><a href="windows-auth-howto.html">30) Windows Authentication</a></li><li><a href="jdbc-pool.html">31) Tomcat's JDBC Pool</a></li><li><a href="web-socket-howto.html">32) WebSocket</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">Tomcat Javadocs</a></li><li><a href="servletapi/index.html">Servlet Javadocs</a></li><li><a href="jspapi/index.html">JSP 2.2 Javadocs</a></li><li><a href="elapi/index.html">EL 2.2 Javadocs</a></li><li><a href="websocketapi/index.html">WebSocket 1.1 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><li><a href="tribes/introduction.html">Tribes</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Tomcat Web Application Deployment</h1><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 +080082<ul><li><a href="#Introduction">Introduction</a></li><li><a href="#Installation">Installation</a></li><li><a href="#A_word_on_Contexts">A word on Contexts</a></li><li><a href="#Deployment_on_Tomcat_startup">Deployment on Tomcat startup</a></li><li><a href="#Deploying_on_a_running_Tomcat_server">Deploying on a running Tomcat server</a></li><li><a href="#Deploying_using_the_Tomcat_Manager">Deploying using the Tomcat Manager</a></li><li><a href="#Deploying_using_the_Client_Deployer_Package">Deploying using the Client Deployer Package</a></li></ul>
83</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>
84 <p>
85 Deployment is the term used for the process of installing a web
刘洪青6266f992017-05-15 21:21:03 +080086 application (either a 3rd party WAR or your own custom web application)
87 into the Tomcat server.
Hongqing Liufd5ee812014-05-10 16:32:51 +080088 </p>
89 <p>
90 Web application deployment may be accomplished in a number of ways
刘洪青6266f992017-05-15 21:21:03 +080091 within the Tomcat server.
92 </p>
Hongqing Liufd5ee812014-05-10 16:32:51 +080093 <ul>
94 <li>Statically; the web application is setup before Tomcat is started</li>
95 <li>
96 Dynamically; by directly manipulating already deployed web
97 applications (relying on <em>auto-deployment</em>
98 feature) or remotely by using the Tomcat Manager web
99 application
100 </li>
101 </ul>
102 <p>
103 The <a href="manager-howto.html">Tomcat Manager</a> is a web
104 application that can be used interactively (via HTML GUI) or
105 programmatically (via URL-based API) to deploy and manage web
106 applications.
107 </p>
108 <p>
109 There are a number of ways to perform deployment that rely on
110 the Manager web application. Apache Tomcat provides tasks
111 for Apache Ant build tool.
刘洪青6266f992017-05-15 21:21:03 +0800112 <a href="http://tomcat.apache.org/maven-plugin.html">Apache Tomcat Maven Plugin</a>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800113 project provides integration with Apache Maven.
114 There is also a tool called the Client Deployer, which can be
115 used from a command line and provides additional functionality
116 such as compiling and validating web applications as well as
117 packaging web application into web application resource (WAR)
118 files.
119 </p>
120 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Installation"><strong>Installation</strong></a></font></td></tr><tr><td><blockquote>
121 <p>
122 There is no installation required for static deployment of web
123 applications as this is provided out of the box by Tomcat. Nor is any
刘洪青6266f992017-05-15 21:21:03 +0800124 installation required for deployment functions with the Tomcat Manager,
125 although some configuration is required as detailed in the
Hongqing Liufd5ee812014-05-10 16:32:51 +0800126 <a href="manager-howto.html">Tomcat Manager manual</a>.
127 An installation is however required if you wish
刘洪青6266f992017-05-15 21:21:03 +0800128 to use the Tomcat Client Deployer (TCD).
129 </p>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800130 <p>
刘洪青6266f992017-05-15 21:21:03 +0800131 The TCD is not packaged with the Tomcat core
132 distribution, and must therefore be downloaded separately from
133 the Downloads area. The download is usually labelled
134 <i>apache-tomcat-7.0.x-deployer</i>.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800135 </p>
136 <p>
137 TCD has prerequisites of Apache Ant 1.6.2+ and a Java installation.
138 Your environment should define an ANT_HOME environment value pointing to
139 the root of your Ant installation, and a JAVA_HOME value pointing to
140 your Java installation. Additionally, you should ensure Ant's ant
141 command, and the Java javac compiler command run from the command shell
142 that your operating system provides.
143 </p>
144 <ol>
145 <li>Download the TCD distribution</li>
146 <li>
147 The TCD package need not be extracted into any existing Tomcat
148 installation, it can be extracted to any location.
149 </li>
刘洪青6266f992017-05-15 21:21:03 +0800150 <li>Read Using the <a href="#Deploying_using_the_Client_Deployer_Package">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800151 Tomcat Client Deployer</a></li>
152 </ol>
153 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="A word on Contexts"><!--()--></a><a name="A_word_on_Contexts"><strong>A word on Contexts</strong></a></font></td></tr><tr><td><blockquote>
154 <p>
155 In talking about deployment of web applications, the concept of a
刘洪青6266f992017-05-15 21:21:03 +0800156 <i>Context</i> is required to be understood. A Context is what Tomcat
Hongqing Liufd5ee812014-05-10 16:32:51 +0800157 calls a web application.
158 </p>
159 <p>
160 In order to configure a Context within Tomcat a <i>Context Descriptor</i>
161 is required. A Context Descriptor is simply an XML file that contains
刘洪青6266f992017-05-15 21:21:03 +0800162 Tomcat related configuration for a Context, e.g naming resources or
Hongqing Liufd5ee812014-05-10 16:32:51 +0800163 session manager configuration. In earlier versions of
164 Tomcat the content of a Context Descriptor configuration was often stored within
165 Tomcat's primary configuration file <i>server.xml</i> but this is now
166 discouraged (although it currently still works).
167 </p>
刘洪青6266f992017-05-15 21:21:03 +0800168 <p>
169 Context Descriptors not only help Tomcat to know how to configure
170 Contexts but other tools such as the Tomcat Manager and TCD often use
Hongqing Liufd5ee812014-05-10 16:32:51 +0800171 these Context Descriptors to perform their roles properly.
172 </p>
173 <p>
174 The locations for Context Descriptors are:
175 </p>
176 <ol>
177 <li>$CATALINA_BASE/conf/[enginename]/[hostname]/[webappname].xml</li>
178 <li>$CATALINA_BASE/webapps/[webappname]/META-INF/context.xml</li>
179 </ol>
180 <p>
181 Files in (1) are named [webappname].xml but files in (2) are named
182 context.xml. If a Context Descriptor is not provided for a Context,
刘洪青6266f992017-05-15 21:21:03 +0800183 Tomcat configures the Context using default values.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800184 </p>
185 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deployment on Tomcat startup"><!--()--></a><a name="Deployment_on_Tomcat_startup"><strong>Deployment on Tomcat startup</strong></a></font></td></tr><tr><td><blockquote>
186 <p>
刘洪青6266f992017-05-15 21:21:03 +0800187 If you are not interested in using the Tomcat Manager, or TCD,
188 then you'll need to deploy your web applications
Hongqing Liufd5ee812014-05-10 16:32:51 +0800189 statically to Tomcat, followed by a Tomcat startup. The location you
刘洪青6266f992017-05-15 21:21:03 +0800190 deploy web applications to for this type of deployment is called the
Hongqing Liufd5ee812014-05-10 16:32:51 +0800191 <code>appBase</code> which is specified per Host. You either copy a
192 so-called <i>exploded web application</i>, i.e non-compressed, to this
193 location, or a compressed web application resource .WAR file.
194 </p>
195 <p>
196 The web applications present in the location specified by the Host's
197 (default Host is "localhost") <code>appBase</code> attribute (default
刘洪青6266f992017-05-15 21:21:03 +0800198 appBase is "$CATALINA_BASE/webapps") will be deployed on Tomcat startup
Hongqing Liufd5ee812014-05-10 16:32:51 +0800199 only if the Host's <code>deployOnStartup</code> attribute is "true".
200 </p>
201 <p>
202 The following deployment sequence will occur on Tomcat startup in that
203 case:
204 </p>
205 <ol>
206 <li>Any Context Descriptors will be deployed first.</li>
207 <li>
208 Exploded web applications not referenced by any Context
刘洪青6266f992017-05-15 21:21:03 +0800209 Descriptor will then be deployed. Note that if an exploded web
210 application has an associated .WAR file in the appBase, Tomcat
211 will not detect if the associated .WAR has been updated while
212 Tomcat was stopped and will deploy the exploded web application
213 as is. The exploded web application will not be removed and
214 replaced with the contents of the updated .WAR file.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800215 </li>
216 <li>.WAR files will be deployed</li>
217 </ol>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800218 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deploying on a running Tomcat server"><!--()--></a><a name="Deploying_on_a_running_Tomcat_server"><strong>Deploying on a running Tomcat server</strong></a></font></td></tr><tr><td><blockquote>
219 <p>
220 It is possible to deploy web applications to a running Tomcat server.
221 </p>
222 <p>
刘洪青6266f992017-05-15 21:21:03 +0800223 If the Host <code>autoDeploy</code> attribute is "true", the Host will
Hongqing Liufd5ee812014-05-10 16:32:51 +0800224 attempt to deploy and update web applications dynamically, as needed,
刘洪青6266f992017-05-15 21:21:03 +0800225 for example if a new .WAR is dropped into the <code>appBase</code>.
226 For this to work, the Host needs to have background processing
Hongqing Liufd5ee812014-05-10 16:32:51 +0800227 enabled which is the default configuration.
228 </p>
刘洪青6266f992017-05-15 21:21:03 +0800229
Hongqing Liufd5ee812014-05-10 16:32:51 +0800230 <p>
231 <code>autoDeploy</code> set to "true" and a running Tomcat allows for:
232 </p>
233 <ul>
234 <li>Deployment of .WAR files copied into the Host <code>appBase</code>.</li>
235 <li>
236 Deployment of exploded web applications which are
237 copied into the Host <code>appBase</code>.
238 </li>
239 <li>
240 Re-deployment of a web application which has already been deployed from
刘洪青6266f992017-05-15 21:21:03 +0800241 a .WAR when the new .WAR is provided. In this case the exploded
242 web application is removed, and the .WAR is expanded again.
243 Note that the explosion will not occur if the Host is configured
Hongqing Liufd5ee812014-05-10 16:32:51 +0800244 so that .WARs are not exploded with a <code>unpackWARs</code>
刘洪青6266f992017-05-15 21:21:03 +0800245 attribute set to "false", in which case the web application
Hongqing Liufd5ee812014-05-10 16:32:51 +0800246 will be simply redeployed as a compressed archive.
247 </li>
248 <li>
刘洪青6266f992017-05-15 21:21:03 +0800249 Re-loading of a web application if the /WEB-INF/web.xml file (or
250 any other resource defined as a WatchedResource) is updated.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800251 </li>
252 <li>
刘洪青6266f992017-05-15 21:21:03 +0800253 Re-deployment of a web application if the Context Descriptor
254 file from which the web application has been deployed is
255 updated.
256 </li>
257 <li>
258 Re-deployment of dependent web applications if the global or
259 per-host Context Descriptor file used by the web application is
260 updated.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800261 </li>
262 <li>
263 Re-deployment of a web application if a Context Descriptor file (with a
264 filename corresponding to the Context path of the previously deployed
刘洪青6266f992017-05-15 21:21:03 +0800265 web application) is added to the
Hongqing Liufd5ee812014-05-10 16:32:51 +0800266 <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code>
267 directory.
268 </li>
269 <li>
270 Undeployment of a web application if its document base (docBase)
刘洪青6266f992017-05-15 21:21:03 +0800271 is deleted. Note that on Windows, this assumes that anti-locking
272 features (see Context configuration) are enabled, otherwise it is not
Hongqing Liufd5ee812014-05-10 16:32:51 +0800273 possible to delete the resources of a running web application.
274 </li>
275 </ul>
276 <p>
277 Note that web application reloading can also be configured in the loader, in which
278 case loaded classes will be tracked for changes.
279 </p>
280 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deploying using the Tomcat Manager"><!--()--></a><a name="Deploying_using_the_Tomcat_Manager"><strong>Deploying using the Tomcat Manager</strong></a></font></td></tr><tr><td><blockquote>
281 <p>
刘洪青6266f992017-05-15 21:21:03 +0800282 The Tomcat Manager is covered in its <a href="manager-howto.html">own manual page</a>.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800283 </p>
284 </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Deploying using the Client Deployer Package"><!--()--></a><a name="Deploying_using_the_Client_Deployer_Package"><strong>Deploying using the Client Deployer Package</strong></a></font></td></tr><tr><td><blockquote>
285 <p>
刘洪青6266f992017-05-15 21:21:03 +0800286 Finally, deployment of web application may be achieved using the
287 Tomcat Client Deployer. This is a package which can be used to
288 validate, compile, compress to .WAR, and deploy web applications to
289 production or development Tomcat servers. It should be noted that this feature
Hongqing Liufd5ee812014-05-10 16:32:51 +0800290 uses the Tomcat Manager and as such the target Tomcat server should be
291 running.
292 </p>
刘洪青6266f992017-05-15 21:21:03 +0800293
Hongqing Liufd5ee812014-05-10 16:32:51 +0800294 <p>
295 It is assumed the user will be familiar with Apache Ant for using the TCD.
296 Apache Ant is a scripted build tool. The TCD comes pre-packaged with a
297 build script to use. Only a modest understanding of Apache Ant is
298 required (installation as listed earlier in this page, and familiarity
299 with using the operating system command shell and configuring
300 environment variables).
301 </p>
刘洪青6266f992017-05-15 21:21:03 +0800302
Hongqing Liufd5ee812014-05-10 16:32:51 +0800303 <p>
刘洪青6266f992017-05-15 21:21:03 +0800304 The TCD includes Ant tasks, the Jasper page compiler for JSP compilation
Hongqing Liufd5ee812014-05-10 16:32:51 +0800305 before deployment, as well as a task which
306 validates the web application Context Descriptor. The validator task (class
307 <code>org.apache.catalina.ant.ValidatorTask</code>) allows only one parameter:
308 the base path of an exploded web application.
309 </p>
刘洪青6266f992017-05-15 21:21:03 +0800310
Hongqing Liufd5ee812014-05-10 16:32:51 +0800311 <p>
312 The TCD uses an exploded web application as input (see the list of the
刘洪青6266f992017-05-15 21:21:03 +0800313 properties used below). A web application that is programmatically
314 deployed with the deployer may include a Context Descriptor in
Hongqing Liufd5ee812014-05-10 16:32:51 +0800315 <code>/META-INF/context.xml</code>.
316 </p>
刘洪青6266f992017-05-15 21:21:03 +0800317
Hongqing Liufd5ee812014-05-10 16:32:51 +0800318 <p>
319 The TCD includes a ready-to-use Ant script, with the following targets:
320 </p>
321 <ul>
322 <li>
刘洪青6266f992017-05-15 21:21:03 +0800323 <code>compile</code> (default): Compile and validate the web
Hongqing Liufd5ee812014-05-10 16:32:51 +0800324 application. This can be used standalone, and does not need a running
325 Tomcat server. The compiled application will only run on the associated
刘洪青6266f992017-05-15 21:21:03 +0800326 <em>Tomcat&nbsp;X.Y.Z</em> server release, and is not guaranteed to work
327 on another Tomcat release, as the code generated by Jasper depends on its runtime
Hongqing Liufd5ee812014-05-10 16:32:51 +0800328 component. It should also be noted that this target will also compile
刘洪青6266f992017-05-15 21:21:03 +0800329 automatically any Java source file located in the
Hongqing Liufd5ee812014-05-10 16:32:51 +0800330 <code>/WEB-INF/classes</code> folder of the web application.</li>
331 <li>
刘洪青6266f992017-05-15 21:21:03 +0800332 <code>deploy</code>: Deploy a web application (compiled or not) to
Hongqing Liufd5ee812014-05-10 16:32:51 +0800333 a Tomcat server.
334 </li>
335 <li><code>undeploy</code>: Undeploy a web application</li>
336 <li><code>start</code>: Start web application</li>
337 <li><code>reload</code>: Reload web application</li>
338 <li><code>stop</code>: Stop web application</li>
339 </ul>
刘洪青6266f992017-05-15 21:21:03 +0800340
Hongqing Liufd5ee812014-05-10 16:32:51 +0800341 <p>
342 In order for the deployment to be configured, create a file
343 called <code>deployer.properties</code> in the TCD installation
344 directory root. In this file, add the following name=value pairs per
345 line:
346 </p>
刘洪青6266f992017-05-15 21:21:03 +0800347
Hongqing Liufd5ee812014-05-10 16:32:51 +0800348 <p>
刘洪青6266f992017-05-15 21:21:03 +0800349 Additionally, you will need to ensure that a user has been
Hongqing Liufd5ee812014-05-10 16:32:51 +0800350 setup for the target Tomcat Manager (which TCD uses) otherwise the TCD
351 will not authenticate with the Tomcat Manager and the deployment will
刘洪青6266f992017-05-15 21:21:03 +0800352 fail. To do this, see the Tomcat Manager page.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800353 </p>
刘洪青6266f992017-05-15 21:21:03 +0800354
Hongqing Liufd5ee812014-05-10 16:32:51 +0800355 <ul>
356 <li>
刘洪青6266f992017-05-15 21:21:03 +0800357 <code>build</code>: The build folder used will be, by default,
358 <code>${build}/webapp/${path}</code> (<code>${build}</code>, by
359 default, points to <code>${basedir}/build</code>). After the end
360 of the execution of the <code>compile</code> target, the web
361 application .WAR will be located at
362 <code>${build}/webapp/${path}.war</code>.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800363 </li>
364 <li>
刘洪青6266f992017-05-15 21:21:03 +0800365 <code>webapp</code>: The directory containing the exploded web application
Hongqing Liufd5ee812014-05-10 16:32:51 +0800366 which will be compiled and validated. By default, the folder is
367 <code>myapp</code>.
368 </li>
369 <li>
刘洪青6266f992017-05-15 21:21:03 +0800370 <code>path</code>: Deployed context path of the web application,
Hongqing Liufd5ee812014-05-10 16:32:51 +0800371 by default <code>/myapp</code>.
372 </li>
373 <li>
刘洪青6266f992017-05-15 21:21:03 +0800374 <code>url</code>: Absolute URL to the Tomcat Manager web application of a
Hongqing Liufd5ee812014-05-10 16:32:51 +0800375 running Tomcat server, which will be used to deploy and undeploy the
刘洪青6266f992017-05-15 21:21:03 +0800376 web application. By default, the deployer will attempt to access
377 a Tomcat instance running on localhost, at
378 <code>http://localhost:8080/manager/text</code>.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800379 </li>
380 <li>
381 <code>username</code>: Tomcat Manager username (user should have a role of
382 manager-script)
383 </li>
384 <li><code>password</code>: Tomcat Manager password.</li>
385 </ul>
刘洪青6266f992017-05-15 21:21:03 +0800386 </blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This comments section collects your suggestions
387 on improving documentation for Apache Tomcat.<br><br>
388 If you have trouble and need help, read
389 <a href="http://tomcat.apache.org/findhelp.html">Find Help</a> page
390 and ask your question on the tomcat-users
391 <a href="http://tomcat.apache.org/lists.html">mailing list</a>.
392 Do not ask such questions here. This is not a Q&amp;A section.<br><br>
393 The Apache Comments System is explained <a href="./comments.html">here</a>.
394 Comments may be removed by our moderators if they are either
395 implemented or considered invalid/off-topic.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
396 var comments_shortname = 'tomcat';
397 var comments_identifier = 'http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html';
398 (function(w, d) {
399 if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
400 d.write('<div id="comments_thread"><\/div>');
401 var s = d.createElement('script');
402 s.type = 'text/javascript';
403 s.async = true;
404 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
405 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
406 }
407 else {
408 d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.<\/strong><\/div>');
409 }
410 })(window, document);
411 //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
412 Copyright &copy; 1999-2017, Apache Software Foundation
Hongqing Liufd5ee812014-05-10 16:32:51 +0800413 </em></font></div></td></tr></table></body></html>