Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I changed the file permission. Now I am not able to access the website.

nginx + php-fpm


chown -R user1:user1 /var/www/

I read in internet, and then i changed the file permission.

groupadd web-content 
usermod -G web-content user1
usermod -G web-content apache

chown -R user1:web-content /var/www/
find /var/www/ -type f -exec chmod 640 {} \;
find /var/www/ -type d -exec chmod 750 {} \;

After this, site is displaying 404 error.

From the above setting i added nginx to the web-content group. Still not working.

usermod -G web-content nginx

Additionally, with this setting, I can't allow users to upload photos to uploads/ directory. But i want to allow users to upload photos

share|improve this question

closed as off-topic by dawud, MadHatter, mdpc, Ward, Iain Oct 13 '13 at 5:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – dawud, MadHatter, mdpc, Ward, Iain
If this question can be reworded to fit the rules in the help center, please edit the question.

File permissions without user/group information is completely useless. – dawud Oct 12 '13 at 10:35
I updated the question! (Also, please remove the negative vote if it is a right question now..) – Mahesh Oct 12 '13 at 10:40
Also, read umask(2) and check its value for the user you log in with FileZilla to upload the files. – dawud Oct 12 '13 at 10:52
I am running nginx with php-fpm. I updated the question – Mahesh Oct 12 '13 at 12:04
up vote 1 down vote accepted

Everything is right. Just the change the file permission to

find /var/www/ -type f -exec chmod 645 {} \;
find /var/www/ -type d -exec chmod 755 {} \;
share|improve this answer

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