Created
October 17, 2012 20:37
-
-
Save aaronott/3908003 to your computer and use it in GitHub Desktop.
Fix D7 file permissions
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
#!/bin/sh | |
PERM_USER=nobody | |
PERM_GROUP=dev | |
APACHE_USER=apache | |
if [ $# -ne 1 ] ; then | |
echo "USAGE $0 <d7 root dir>" | |
exit; | |
fi | |
# set all files to 664 permissions | |
find $1 -type f -exec chmod 664 {} \; | |
# set all directories to 775 permissions | |
find $1 -type d -exec chmod 775 {} \; | |
# change owner to nobody and group to dev for everything in the webroot | |
# directory then change sites/default/files owner to apache | |
chown -R $PERM_USER:$PERM_GROUP $1; chown -R $APACHE_USER $1/sites/default/files; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wonderful!