As Linux Administrator many time you need to set default permission of files created on a Linux system. You can easily set if you are using bash just define somewhere in the bash script startup file /etc/profile and set the below value.
Using above value will allow by default group write permissions on the newly created files.
Set Umask in Apache
You can easily find out the default umask value using below command on Linux system.
In opposition to what you may think, this isn’t sufficient to have this working for all applications and daemons on the system. This works fine for any files created from a shell session, but the files created by other processes, like the web server for example, will still use the default, unless otherwise configured. In order to have apache use a different umask we can define this inside /etc/apache2/envvars (debian, and ubuntu systems) or /etc/sysconfig/httpd (rhel,centos systems) like below:
Next restart the apache service to apply the changes.
# service httpd restart OR # service apache2 restart