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, devand 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-dataas owner group. Setting www-data as owner fixes the problem but then devand 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 !

  • I'm confused - something is not right. Please post the output of two commands: #1 -- ps -ef | egrep '(apache|httpd)'; #2 -- id apache; - thanks. The semicolons are there for clarity, not required. – jim mcnamara Jan 29 '15 at 20:51
  • Thanks for you help. Here are the outputs : pastebin.com/bd0TvczQ – Bertrand Jan 30 '15 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.