Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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.