Skip to content

Instantly share code, notes, and snippets.

@pkhamre
Created March 13, 2012 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkhamre/2029337 to your computer and use it in GitHub Desktop.
Save pkhamre/2029337 to your computer and use it in GitHub Desktop.
WordPress file permissions
#!/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