0

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

nginx + php-fpm

previously,

chown -R user1:user1 /var/www/site.com

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/site.com
find /var/www/site.com -type f -exec chmod 640 {} \;
find /var/www/site.com -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

Mahesh
  • 237
  • 1
  • 3
  • 16
  • 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
  • take a look at this Qs: http://serverfault.com/questions/357108/what-are-the-best-linux-permissions-to-use-for-my-website, http://serverfault.com/questions/124800/how-to-setup-linux-permissions-for-the-www-folder. http://serverfault.com/questions/6895/whats-the-best-way-of-handling-permissions-for-apache2s-user-www-data-in-var – dawud Oct 12 '13 at 10:51
  • 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

1 Answers1

1

Everything is right. Just the change the file permission to

find /var/www/site.com -type f -exec chmod 645 {} \;
find /var/www/site.com -type d -exec chmod 755 {} \;