Gentoo / Tomcat 6
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Sep 8, 2009 10:34:51 AM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /www/rivervalley/site does
not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(Unknown Source)
at org.apache.catalina.core.StandardContext.resourcesStart(Unknown Source)
at org.apache.catalina.core.StandardContext.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
哦是吗?那为什么呢:
ls -la /www/rivervalley/site/
drwxr-xr-x 12 tomcat tomcat 4096 Sep 8 09:56 .
drwxr-xr-x 16 tomcat tomcat 4096 Jun 29 16:22 ..
-rwxr--r-- 1 tomcat tomcat 520 Jul 3 02:15 Application.cfm
drwxr-xr-x 2 tomcat tomcat 4096 Sep 8 09:56 WEB-INF
和 ...
tomcat 18916 1.0 5.5 1159188 167892 ? Ssl 10:37 0:11 /opt/sun-jdk-1.5.0.18/bin/java -Djava.util.loggin
见鬼,任何帐户都可以读取该目录,所以这个说法完全是胡说八道。还有什么原因导致这种情况?
这是我的相关 server.xml 部分:
<Host name="rivervalley" appBase="webapps" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/www/rivervalley/site" />
</Host>
答案1
检查父目录的权限:
ls -ld /www /www/rivervalley
两个目录对于 tomcat 用户或组都必须具有“执行”权限。
答案2
<Host name="rivervalley" appBase="webapps" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/www/rivervalley/site" />
</Host>
我不太了解 tomcat,但是您是否尝试过在网站上放置尾部斜杠?
IE:
<Host name="rivervalley" appBase="webapps" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/www/rivervalley/site/" />
</Host>