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

So, I'm having some problems with my permissions.

I have a directory named /sites/ and within that directory i have a couple of more directories of all my vhosts. One of them for example is /sites/rb.

/sites/rb/application/.. /sites/rb/public_html/index.php

I'm editing the files over sFTP, with my user "jimp", jimp is part of the group www-pub.

chown –R root:www-pub /sites/rb

If i simply type "touch abc" i get this: -rw-r--r-- 1 jimp www-pub 0 30 jun 23.55 abc

and if i create a file with my sftp client i get: -rw-r--r-- 1 jimp www-pub 0 30 jun 23.55 abc_sftp

The problem is that nginx can't access my site. Nginx error log: 2010/06/30 23:45:36 [crit] 5459#0: *3 stat() "/sites/rb/public_html/index" failed (13: Permission denied), client:, server:, request: "GET /index HTTP/1.1", host: ""

I'm using php5-fpm.

I'm sorry for my poor english. I would appreciate any help very much because this is not my area! :-)

share|improve this question
up vote 0 down vote accepted



at least chmod 711?

Actually, in looking at that a little closer, it looks like it is trying to access /sites/rb/public_html/ on your filesystem rather than the correct path. It would seem that you may have

location / {
    root /sites/rb/public_html/;

rather than having the proper full path for root.

share|improve this answer
Yes! drwxrw-r-- 6 jimp www-pub 4096 30 jun 19.26 public_html – Jimps Jun 30 '10 at 22:15
those permissions would be incorrect. At a minimum, you need to chmod 711 that directory. You have it currently set to chmod 762, which doesn't give nginx the ability to traverse the public_html directory. – karmawhore Jun 30 '10 at 22:18
location / { root /sites/rb/public_html/; index index.php index.html; if (!-f $request_filename) { rewrite ^(.*)$ /index.php?$1 last; } } location ~ \.php$ { fastcgi_pass; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /sites/rb/public_html$fastcgi_script_name; include fastcgi_params; } That's my config. And to be clear, if I for example set all files and folders to 755 it works. – Jimps Jun 30 '10 at 22:23
755 or 711 would work. Nginx didn't have permissions to read the directory listing. Reading the directory listing requires the execute privilege. So, if you set it to 711 or 755 and it works, what problem are you having? – karmawhore Jun 30 '10 at 22:27
Usually easier to edit your question to post configurations since comments don't allow formatting. – karmawhore Jun 30 '10 at 22:34

Your Answer


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