【发布时间】:2013-05-27 23:24:33
【问题描述】:
我喜欢使用 [http://www.mysite.com] 访问我的网站 [http://www.mysite.com/my-web-site]
我在/conf/server.xml中定义了一个Host如下
<Host name="www.mysite.com" appBase="lpsadmin" unpackWARs="true" autoDeploy="true" copyXML="true" />
在我的 my-web-site.war 我在 META-INF 下有 context.xml,其中包含以下内容
<Context path="" docBase="/my-web-site" reloadable="true" allowLinking="true" cacheMaxSize="40960"/>
从 Tomcat 文档中,我知道当 Host 有一个 appBase 时,docBase 将不会被使用。正如预期的那样,我收到以下警告
WARNING: A docBase /Applications/tomcatstack-7.0.32-0/apache-tomcat/lpsadmin/my-web-site inside the host appBase has been specified, and will be ignored
当 Host 有 appBase 时,我如何更改我的上下文路径?我不喜欢 ROOT.xml 解决方案。
【问题讨论】:
标签: tomcat7 virtualhost