Last active
December 19, 2015 21:19
-
-
Save nedmas/6019363 to your computer and use it in GitHub Desktop.
Simple shell script to set file permissions for a Magento installation.
This file contains 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/bash | |
if [ $# -lt 1 ] | |
then | |
echo "Usage : $0 [dir]" | |
exit | |
fi | |
chown -R dev:dev $1 | |
find $1 -type d -exec chmod 755 {} \; | |
find $1 -type f -exec chmod 644 {} \; | |
find "$1/app/etc" -type d -exec chown dev:www-data {} \; | |
find "$1/app/etc" -type d -exec chmod 775 {} \; | |
find "$1/app/etc" -type f -exec chown dev:www-data {} \; | |
find "$1/app/etc" -type f -exec chmod 664 {} \; | |
find "$1/includes" -type d -exec chown dev:www-data {} \; | |
find "$1/includes" -type d -exec chmod 775 {} \; | |
find "$1/includes" -type f -exec chown dev:www-data {} \; | |
find "$1/includes" -type f -exec chmod 664 {} \; | |
find "$1/var" -type d -exec chown dev:www-data {} \; | |
find "$1/var" -type d -exec chmod 775 {} \; | |
find "$1/var" -type f -exec chown dev:www-data {} \; | |
find "$1/var" -type f -exec chmod 664 {} \; | |
find "$1/media" -type d -exec chown dev:www-data {} \; | |
find "$1/media" -type d -exec chmod 775 {} \; | |
find "$1/media" -type f -exec chown dev:www-data {} \; | |
find "$1/media" -type f -exec chmod 664 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment