Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active January 28, 2016 10:50
Show Gist options
  • Save jasperf/4748666 to your computer and use it in GitHub Desktop.
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
//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
@jasperf
Copy link
Author

jasperf commented Sep 24, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment