Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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>

  DocumentRoot "/home/sneedmoure/deployed_rails_apps/myapp/current/public" 
  ErrorLog "logs/"
  CustomLog "logs/" common
  CustomLog "logs/" 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


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?

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
Can't su to user apache. Apparently not a type of user that can log in. However, I'm pretty sure the permissions are OK. – Agvorth Nov 25 '09 at 22:45
To su to it you'd need to edit /etc/passwd and temporarily change its shell to /bin/bash (or whatever your normal shell is). – EMP Nov 26 '09 at 22:59
I moved it to a different dir under /. I think the deal was that user apache needs read and execute on the entire line of dirs leading to the application. – Agvorth Nov 27 '09 at 23:33
It would need execute permissions on the entire directory tree, yes. Read permissions would only be needed on any web directories you want to list files in. – EMP Nov 29 '09 at 22:04

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?

share|improve this answer
Good thought. But yes, there is an index file. – Agvorth Nov 25 '09 at 22:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.