On my web server I have two distinct folders, /home/dev/
and /home/prod/
, each containing several websites.
As you can guess, each directory is owned by the corresponding user, dev
and prod
.
The permissions I put on the directories and its subdirectories are the following :
drwxrwsr-x dev www-data
drwxrwsr-x prod www-data
The directories are 2775
and the files are 0664
.
Both users dev
and prod
are part of the www-data
group.
With this configuration, both dev
and prod
are able to read and write their own files, but Apache appears not to be able to write.
For example, when I want to install a Drupal module through the backoffice, or when I want to update a Wordpress core, I get asked my FTP login.
Which is weird since everything has www-data
as owner group.
Setting www-data
as owner fixes the problem but then dev
and prod
can't modify their files anymore.
So the question is, how can I keep all files editable by their respective owners while making them writable by Apache ?
Thank you !