Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When Apache writes new files (static content, like writing to the cache file) it creates this file without the proper permissions. There's no write permission for the group by default and this causes problems for us. Can we change the umask that apache starts with?

share|improve this question

2 Answers 2

Apache inherits its umask from its parent, so simply set the umask in the script that starts Apache.

There's a similar question on StackOverflow that talks about this too, and they offer at least one OS-specific way of doing it, but the above is the general method.

share|improve this answer
    
Thanks voretaq7. I should have specified, I'm using Ubuntu. –  Ted LeRoy Mar 30 '12 at 17:43

For CentOS and related distros add the umask command to /etc/sysconfig/httpd.

On an Ubuntu system, the apache2 init script reads the contents of /etc/default/apache2 so you could put your umask command in there.

share|improve this answer
    
Thanks lain. I am using Ubuntu, so this is very helpful. –  Ted LeRoy Mar 30 '12 at 17:44

Your Answer

 
discard

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.