I’m working on BOINC project.
I have two users: boincadm and www-data (for apache).
Both belong to group boinc
www-data : boinc www-data boincadm
boincadm : boinc adm dialout fax cdrom floppy tape audio dip www-data video plugdev netdev bluetooth lpadmin fuse scanner sambashare subversion
I have a boinc project created in /home/boincadm/projects/myproject/
All files and folders there are owned by boincadm : boinc and have rwxrwx— permissions.
The problem is that www-data user can not access to files, which causes multiple errors like:
Warning: require_once(../inc/db.inc): failed to open stream: Permission denied in /home/boincadm/projects/myproject/html/user/index.php
Fatal error: require_once(): Failed opening required ‘../inc/db.inc’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /home/boincadm/projects/myproject/html/user/index.php
or just
Can’t access the file XXX
in logs..
IF I change grant rwx to "others" (777) it works..
My question is, why don’t the group permissions work as I expect? Any ideas?
I’m not an expert in linux, thus I could miss something.
Here is how I solved it:
First of all I read this:
link
At some point this article mentioned file
/etc/groupwhe information about groups is stored.I opened this file and mentioned that inspite of my previous actions there is no
www-datain groupboinc. And nowww-datain groupboincadmand the opposite. That is strange!Strange because I’ve added these users to group boinc using
usermodcommand and made sure this group is primary for both.Moreover command
groups <username>showed that they are in groupboinc.So now the question is: Why this happened?
The problem was solved by modifying 3 lines:
I needed all 3 lines to make it work. Hope it helps somebody. And I still would like to understand why the file
/etc/groupwas not modified automatically when usingusermod. And why grops shows correct result if so.