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

I use nginx 1.4.4 and I created a chrooted user. This user can only see his /home/user folder, and I created in a "www" folder.

I put in my virtual host file :

root /home/user/www;

But I have an error :

*1 stat() "/home/crm/www/" failed (13: Permission denied)

I try to put chmod 777 on home, home/user, home/user/www, but I got the error.

I took a look on this question : nginx + PHP-FPM = "permission denied" error 13 in nginx log; configuration mistake?, but I can't change owner the www folder.

How can I correct this ? Thanks.

share|improve this question

2 Answers 2

Add your user to www-data group (Nginx should run as www-data).

share|improve this answer
    
Or chown www to user:www-data. (with r option). –  Thomas Decaux Feb 7 at 13:34

Ok a lot of chmod after... I achieve what I wanted ! I got an other error on :

My config (namei -om /home/crm/www) :

drwxr-xr-x root root /
drwxr-xr-x root root home
drwxr-xr-x root root crm
drwxrwxrwx crm  sftp www

And I have another error too on :

fastcgi_param SCRIPT_FILENAME   $request_filename;

The filename was bad an make an "file not found error" too.

share|improve this answer

Your Answer

 
discard

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.