2

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?

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.

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

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.

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

Your Answer

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

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