There is no docBase attribute for an Host. There is one for the context as you can see in your snippet.
Per the documentation :
The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host.
(see Tomcat 7.0.x documentation)
To declare a personnalised docbase
, you will have to set it in all context
declaration for the host. (As a side note, it is strongly discouraged to declare context
in web.xml, you should add an xml file in the folder conf/<engine-name>/<host>
)
As an alternative, seeing as you have an appBase
attribute on your host, you can just deploy your war in that path and the doc base will then be the path to your war (expended or not following the other attributes).
For exemple, let's say we have an host in server.xml like :
<Host name="exemple.org" appBase="webapps/exemple.org">
</Host>
andan application i want to deploy to exemple.org/appli
. Either I add a file appli.xml in conf/Catalina/exemple.org/
which content is :
<Context docBase="<path/to/war>" ... />
Or I put the war (named appli.war
) in webapps/exemple.org/
Again see Tomcat Documentation for all the details.