/var/log/tomcat-7/catalina.2011-09-05.log:
INFO: Starting service Catalina
Sep 5, 2011 8:33:51 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.21-gentoo
Sep 5, 2011 8:33:53 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet threw load() exception
java.io.FileNotFoundException: /opt/railo/lib/railo-server/patches/3.1.2.001.rc (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at railo.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:222)
at railo.loader.engine.CFMLEngineFactory.getEngine(CFMLEngineFactory.java:171)
at railo.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:72)
at railo.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:111)
at railo.loader.servlet.CFMLServlet.init(CFMLServlet.java:26)
at org.apache.catalina.core.StandardWrapper.initServlet(Unknown Source)
at org.apache.catalina.core.StandardWrapper.loadServlet(Unknown Source)
at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
at org.apache.catalina.core.StandardContext$3.call(Unknown Source)
at org.apache.catalina.core.StandardContext$3.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
...然而
# ls -la /opt/railo/lib/railo-server/patches/3.1.2.001.rc
-rw-rw-r-- 1 tomcat web 6497683 Mar 3 2010 /opt/railo/lib/railo-server/patches/3.1.2.001.rc
我看起来非常方便,tomcat可以读取和写入,所以“权限被拒绝”在这种情况下究竟是什么意思?
虽然它可能与站点根目录或WEB-INF文件夹上的权限有关,但它们看起来也很好:
# ls -la /www/mysite/site/
drwxrwxr-x 8 root web 4096 Sep 5 20:43 .
drwxr-xr-x 15 me web 4096 Aug 18 13:01 ..
drwxr-xr-x 4 tomcat tomcat 4096 Sep 5 20:43 WEB-INF
安装是在Gentoo Linux上运行的Tomcat 7 + Railo 3.3(以前从树脂3.1.2升级),其中Apache 2.2.20以tomcat
组中的用户web
运行。
/etc/tomcat-7/catalina.properties:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/opt/railo/lib,/opt/railo/lib/*.jar
/etc/tomcat-7/server.xml:
<Host name="mysite.myhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/www/mysite/site" />
<Logger className="org.apache.catalina.logger.FileLogger"/>
</Host>