Skip to content

Instantly share code, notes, and snippets.

@sibil
Created June 17, 2021 11:49
Show Gist options
  • Save sibil/a5f9212ae439d562a0a27fa3982c5c9c to your computer and use it in GitHub Desktop.
Save sibil/a5f9212ae439d562a0a27fa3982c5c9c to your computer and use it in GitHub Desktop.
Set appropriate permission for Drupal 8
#assuming centos user and apache
#in ubuntu, please use ubuntu:www-data
#chown -R ubuntu:www-data .
chown -R centos:apache .
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;
#Ensure that the sites directory is proper
cd web/sites/
find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
for d in ./*/files
do
find $d -type d -exec chmod ug=rwx,o= '{}' \;
find $d -type f -exec chmod ug=rw,o= '{}' \;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment