Friday, September 18, 2015

permissions - Setup web folder for multiple developers and Apache

I'm trying to setup a web folder on LAMP with Ubuntu 14.04 where :





  1. Apache/PHP can read everything inside. (r-x for folders and r-- for files)

  2. Multiple users in a "devs" group can do anything inside. (rwx for folders and rw- for files)

  3. Newly created folders and files have the same properties as above.



I know there is this answer that looked pretty good at first, until i tried to access from the web and i got a 403 permission denied.






Should i use only one "dev" user that can modify the web folder ?




I could also use ACL ?



EDIT : Not a duplicate of https://serverfault.com/a/357109/354883 because it doesn't solve the problem for newly created files.



MY SOLUTION: Since i didn't found anything on the standard permission system that could do exactly what i wanted, i checked ACL.



What i did:





  • sudo apt-get install acl You also may wanna mount your parition so it enables ACL

  • sudo setfacl -Rm g:coders:rwx,g:www-data:r-x,o:--- webfolder

  • sudo setfacl -Rm d:g:coders:rwx,d:g:www-data:r-x,d:o:--- webfolder

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...