Created
March 13, 2012 15:09
-
-
Save pkhamre/2029337 to your computer and use it in GitHub Desktop.
WordPress 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/bash | |
PATH=/bin:/usr/bin | |
WEBROOT="/var/www/www.example.com" | |
UPLOADS="${WEBROOT}/wp-content/uploads" | |
chown -R nobody:nogroup ${WEBROOT} | |
find ${WEBROOT} -type d -exec chmod 0555 {} \; | |
find ${WEBROOT} -type f -exec chmod 0444 {} \; | |
chown nobody:www-data ${WEBROOT}/sitemap.xml ${WEBROOT}/sitemap.xml.gz | |
chmod 0464 ${WEBROOT}/sitemap.xml ${WEBROOT}/sitemap.xml.gz | |
chown -R nobody:www-data ${UPLOADS} | |
find ${UPLOADS} -type d -exec chmod 2575 {} \; | |
find ${UPLOADS} -type f -exec chmod 0464 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment