Thursday, December 17, 2015

security - File Permissions created by Apache



OS: CentOs



Whenever apache (apache2) creates a file or directory it automatically sets the permissions to 777. I want it's directories to be 775 and files 664. How can I fix this?



Answer



Put umask 002 in the end of /etc/sysconfig/httpd and restart httpd (service restart httpd) and it should do the trick for future files. Apache inherits the umask from its parent process, so this setup makes that happen.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...