I would like to have this setup in Tomcat:
- virtual host
- webapp resides directly in ROOT and is autoDeployed
- I need to pass some specific webapp parameter in Tomcat configuration (outside war)
1st I have this scenario:
<Host name="my.domain.com" appBase="vhosts/my.domain.com" unpackWARs="true" autoDeploy="true">
</Host>
and ROOT.war in directory $CATALINA_BASE/vhosts/my.domain.com/
-> everything works fine
2nd now I try to add the context parameter
<Host name="my.domain.com" appBase="vhosts/my.domain.com" unpackWARs="true" autoDeploy="true">
<Context docBase="/" reloadable="true">
<Parameter name="serverRole" value="dev" override="true"/>
</Context>
</Host>
-> app is no more accessible by my.domain.com (404)
-> I also tried to move the Context from Host to separate ROOT.xml file residing in $CATALINA_BASE/conf/Catalina/my.domain.com/ but with no success
Actually I don’t know what to set for path or docBase, but it seems that I am lost.
Finally I found the solution.
Final words,
the thing why it didn’t come to my mind to remove the docBase attribute at the beginning was that I thought that it was mandatory attribute as it is marked bold in the Tomcat’s documentation.
JoeK