6

I want to deploy web application in directory(e.g \Users\username\myapps\app1) other than webapps folder.

I know to how to change "appBase" other than webapps by setting "appBase" attribute in "host" tag in server.xml in conf directory.

But problem is, I don't want to change whole webapps directory, I just want to deploy one application not in webapps directory.

Parth
  • 527
  • 1
  • 8
  • 17
  • 2
    your question was answered here - http://stackoverflow.com/questions/661166/how-to-deploy-external-webapp-in-tomcat – radai Nov 19 '13 at 06:19
  • thanks radai for quick response. let me check it & apply it. – Parth Nov 19 '13 at 06:20
  • 1
    Possible duplicate of [How to deploy external webapp in tomcat?](http://stackoverflow.com/questions/661166/how-to-deploy-external-webapp-in-tomcat) – Tom Panning Apr 19 '17 at 14:13

1 Answers1

10

Use a context.xml file placed in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory.

  • enginename -> server.xml - Server/Service/Engine[@name] Default is Catalina.
  • hostname -> server.xml - Server/Service/EngineHost[@name] Default is localhost.

You can specify the absolute path or relative path in the docBase attribute.

<Context docBase="/Users/username/myapps/app1">
</Context>

See http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

PS (from the tomcat doc):

It is NOT recommended to place elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.

René Link
  • 48,224
  • 13
  • 108
  • 140
  • 2
    Thanks link. I have already followed answer of "http://stackoverflow.com/questions/661166/how-to-deploy-external-webapp-in-tomcat" question. – Parth Nov 19 '13 at 06:32