解
Apache至less需要在虚拟目录的所有父目录上执行权限。
我试图在CentOS 4.3上设置一个在Apache下运行的Rails应用程序。 我使用Phusion Passenger( mod_rails )我确保应用程序部署目录由组Apache拥有,权限设置为允许组读取它。
在我的Apacheconfiguration,我有…
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/home/sneedmoure/deployed_rails_apps/myapp/current/public" ServerName myapp.com ServerAlias www.myapp.com ErrorLog "logs/myapp.com-error_log" CustomLog "logs/myapp.com-access_log" common CustomLog "logs/myapp.com-deflate_log" deflate <Directory "/home/sneedmoure/deployed_rails_apps/myapp/current/public"> Order allow,deny Allow from all #AllowOverride all # Not sure whether I need this Options -MultiViews # Passenger docs say to include this </Directory> </VirtualHost>
当我尝试在浏览器中访问我的应用程序时,出现403错误。
在错误日志中我得到像…
[Wed Nov 25 03:01:19 2009] [error] [client 123.456.789.12] (13)Permission denied: access to / denied
我已经在应用程序内尝试了不同的path,并得到相同的结果。 它在我的开发机器上工作得很好。
任何想法我做错了什么?
我能想到的唯一原因是Web服务器用户无权访问该目录(/ home / sneedmoure / deployed_rails_apps / myapp / current / public)。
您可以通过访问Web服务器用户帐户并尝试列出目录来validation。
该目录中是否有索引文件(例如index.html,index.htm等)? 如果没有,它可能是抱怨B / C任何请求该目录出现作为尝试检索目录列表。 你可以在该目录中创build一个空白文件(例如test.txt)并成功地将其加载到浏览器中?