SOLUTION
Apache needs at least execute permissions on all the parent directories of the vhost dir.
I'm trying to set up a Rails app running under Apache on CentOS 4.3. I'm using Phusion Passenger (mod_rails
) I made sure the app deployment dir is owned by group Apache and the permissions are set to allow the group to read it.
In my Apache config I have...
<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>
When I try to access my app in the browser I get a 403 error.
In the error log I'm getting entries like...
[Wed Nov 25 03:01:19 2009] [error] [client 123.456.789.12] (13)Permission denied: access to / denied
I've tried different paths within the app and get the same result. It does work fine on my development machine.
Any notion what I'm doing wrong?
The only reason I can think of is that the web server user doesn't have access to that directory (/home/sneedmoure/deployed_rails_apps/myapp/current/public).
You could verify that by su-ing to the web server user account and trying to list the directory.
Is there an index file (e.g. index.html, index.htm, etc) in that directory? If there isn't, it could be complaining b/c any request for that dir appears as an attempt to retrieve the directory listing. Can you create a blank file in that directory (e.g. test.txt) and successfully get it to load in a browser?