Last active
January 28, 2016 10:50
-
-
Save jasperf/4748666 to your computer and use it in GitHub Desktop.
Changing file and directory permissions to make site safer after tinkering with file and directory permissions. This will make all directories 755/775 and all files 664/664 #chmod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//useful when PHP is running as Apache Module | |
find . -type d -print0 | xargs -0 chmod 0775 # For directories | |
find . -type f -print0 | xargs -0 chmod 0664 # For files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also if you need to have apache install files with umask that allows group users to overwrite these use
[root ~]$ echo "umask 002" >> /etc/sysconfig/httpd
[root ~]$ service httpd restart
//http://stackoverflow.com/questions/428416/setting-the-umask-of-the-apache-user