Skip to content

Instantly share code, notes, and snippets.

@calvez
Last active June 5, 2016 10:05
Show Gist options
  • Save calvez/576772f5fd448fd18393bcd020380f00 to your computer and use it in GitHub Desktop.
Save calvez/576772f5fd448fd18393bcd020380f00 to your computer and use it in GitHub Desktop.

#Example Drupal permissions Setup credit: FranCarstens

CPanel User: username Site Root: /home/username/public_html Ownership

  • Files and folders username:nobody
  • Temporary Folder username:nobody
  • Permissions
  • Core modules folders 750 RWXR-X---
  • Core modules files 640 RW-R-----
  • Core themes folders 750 RWXR-X---
  • Core themes files 640 RW-R-----
  • Contrib modules folders 750 RWXR-X---
  • Contrib modules files 640 RW-R-----
  • Contrib themes folders 750 RWXR-X---
  • Contrib themes files 640 RW-R-----
  • Files folders 770 RWXRWX---
  • Files files 660 RW-RW----
  • Temporary folder 770 RWXRWX---
  • Settings file 440 R--R-----
  • Settings folder 750 RWXR-X---
  • Update ownership for entire site and tmp folder

chown -R username:nobody /home/username/public_html

chown username:nobody /home/username/tmp

Permissions

find /home/username/public_html/modules -type d -exec chmod 750 {} +

find /home/username/public_html/modules -type f -exec chmod 640 {} +

find /home/username/public_html/themes -type d -exec chmod 750 {} +

find /home/username/public_html/themes -type f -exec chmod 640 {} +

find /home/username/public_html/sites/all/modules -type d -exec chmod 750 {} +

find /home/username/public_html/sites/all/modules -type f -exec chmod 640 {} +

find /home/username/public_html/sites/all/themes -type d -exec chmod 750 {} +

find /home/username/public_html/sites/all/themes -type f -exec chmod 640 {} +

find /home/username/public_html/sites/default/files -type d -exec chmod 770 {} +

find /home/username/public_html/sites/default/files -type f -exec chmod 660 {} +

find /home/username/tmp -type d -exec chmod 770 {} +

chmod 440 /home/username/public_html/sites/default/settings.php

chmod 750 /home/username/public_html/sites/default

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