Why is group write permission ignored in Ubuntu?

0

0

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?

ndp

Posted 2012-09-27T15:14:54.457

Reputation: 103

Answers

2

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.

Haqa

Posted 2012-09-27T15:14:54.457

Reputation: 549

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 – ndp – 2012-09-28T14:05:00.593