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?
Asked
Active
Viewed 1,263 times
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.
-
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.

user9517
- 115,471
- 20
- 215
- 297