Sunday, December 28, 2014

linux - File Permission on /var/www/html




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


Answer



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 {} \;

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...