Possible Duplicate:
Permissions: What's the right way to give Apache more user permissions?

Before I knew better, I used /home/someuser/public_html/scripts as a place from which shared scripts could be accessed by various users' php scripts.


Something changed when we went from one server to another and now the only way that was working was to set public_html to 0755. Since we now have some customers with access to their own accounts, this is not acceptable. I tested a work around by adding a user to the same group as someuser and putting another folder at /home/someuser/test_folder and setting it to 0750. Now my users who share the group can access test_folder. A user that is not in the group cannot, but if I chmod public_html from 755 to 750, I get permission errors even from the users that are in the same group. I checked lsattr and the only attrib that is set is "I" on public_html

Any ideas on what to try next?

marked as duplicate by Gilles, Renan, Ulrich Dangel, jasonwryan, daisy Sep 7 '12 at 5:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Your description isn't very clear, but if I understand correctly you did the right thing. Copy-paste the output of ls -ld /home/someuser /home/someuser/public_html /home/someuser/public_html/scripts /home/someuser/public_html/scripts/somefile.php and of su -c groups user1 where user1 is not in the group. – Gilles Aug 17 '12 at 18:24
  • I found out that I was mistaken. public_html was (is) in the "nobody" group, and so is apache, so my grouping idea won't work. – TecBrat Aug 17 '12 at 18:49
  • Don't let any file belong to nobody or run any process as nobody: that's what it's for. Create another group. And use access control lists (ACLs) to manage permissions, that's almost always the answer to website permission woes. – Gilles Aug 17 '12 at 21:25

The solution was # setfacl -m g:someuser:rx /home/someuser/public_html

Read that like this "Set File Access Control List, Modify, Group:someuser:read,execute, /home/someuser/public_html"

This forum question is what pointed me in the right direction.

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