Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: 11.11.11.111, server: rb.rb.com, request: "GET /index HTTP/1.1", host: "rb.rb.com"

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

1 Answer 1

up vote 0 down vote accepted

is

/sites/rb/public_html/

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 127.0.0.1:9000; 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

 
discard

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