Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want my user to have full access to the local Apache root folder, and I also want the Apache user to have full access to the same folder.

What I did was create a new group called DevGroup and I added my user and www-data there. Also I changed the permissions to 770 to allow full group access.

But now it won't allow me or the Apache user any kind of access to the folder.

Here is what I get with ls:

drwxrwx--- 12 root      DevGroup    4096 Sep 27 17:34 testFolder

Which seems perfect but when I try as a user to access the file I get this:

var/www$ ls testFolder/
ls: cannot open directory testFolder/: Permission denied

Also when I try to access a page in the folder from a browser:

[Thu Sep 27 17:47:16 2012] [error] [client 127.0.0.1] PHP Fatal error: 
 Unknown: Failed opening required '/var/www/testFolder/foo.php' 
(include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

What's the problem and how can I fix it?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

What you describe should work, but you might need to log out and restart apache for them to pick up the new group memberships.

If this folder is under the webroot then it is reasonable to consider it the "property" of the webserver, so you could leave it owned by user www-data, and group DevGroup, this would ensure that the webserver is always able to access it.

share|improve this answer
    
you are right, when i fired up the laptop today it worked so i guess it needed a restart :D thx for your answer :D –  NorthPole Sep 28 '12 at 14:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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