A memo on how to configure umask for the Apache execution user.
# find / -name envvars
/usr/local/apache2/bin/envvars
# vim /usr/local/apache2/bin/envvars
# umask 002 to create files with 0664 and folders with 0775
umask 002
# service httpd restart
For example, this setting is useful in automated deployment operations with Capistrano.
When you want to enable deployment from various users in Capistrano automated deployment, you can solve file permission issues with umask configuration.
Add Apache and users with deployment permissions to a common group (like “deploy”) and make it the group owner of the web application files you want to operate.
Then, set permissions to 664 for files and 775 for directories, so errors won’t occur even when deleting files during operations like “cap deploy:cleanup”.
[Reference]: /etc/sysconfig/httpd
That’s all from the Gemba.