I'd like to deploy a web application in folder
C:\webApp
to Tomcat7.x instead of having a copy under
%TOMCAT_HOME%\webapps
Which configuration is required on tomcat server?
1. Create a file name <yourapp>.xml inside location ${CATALINE_HOME}/conf/Catalina/localhost
2. Add the below content in the xml file created above
<Context displayName="yourapp"
docBase="/path/to/yourapp"
path="/yourapp"
reloadable="true" />
3. Restart tomcat
Have a look at the Tomcat configuration guide which shows you how to do this.
[Contexts can be defined in] individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The context path and version will be derived from the base name of the file (the file name less the .xml extension). This file will always take precedence over any context.xml file packaged in the web application's META-INF directory.
The context.xml
file in this case must include a <Context>
element with a docBase
attribute pointing to the WAR file (or exploded WAR directory) where your application resides on the disk (in your case: C:\webApp
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With