I want anyone in group www-data to have write access to /var/www
. For example, if 'a' and 'b' are in group www-data and 'a' creates a file in /var/www
- then 'b' will be able to edit it.
The problem is that I create files that PHP and Apache can't edit - and they create files I can't edit without sudo. Both PHP and myself are in www-data group.
I changed the umask setting /etc/profile
from umask 022
to umask 002
. Is this a safe and proper way to handle this?
Update: Even after changing /etc/profile and restarting the computer PHP still creates files with permission -rw-r--r--
.