Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been told to chgrp and chmod (770 and g+s) the directory I need to be shared between the user 'apache' and the user that owns the website files.

When the owner creates new files in there, they have by default this permissions: 664, which isn't perfect, but it's ok.

The problem is that when apache (with a php script) creates new files in there, they have this permissions: 644.

Then the files created by apache are not writtable by the group. How do I fix that? I want it to be 664 by default, or 770.

share|improve this question
up vote 0 down vote accepted

You cannot have both 0664 and 0770, but if you set the umask to 0002 before running httpd then you can have 0664 and 0775. Note that this may require modification of the initscript used to start it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.