Created
January 16, 2017 16:21
-
-
Save morad7/255aa87da5ae85e01697d84dbb4f0315 to your computer and use it in GitHub Desktop.
Drupal permissions
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
# Create a new example user. | |
useradd -s /bin/bash -m example; | |
# Now add that user to the Apache group. On Ubuntu/Debian this group is usually | |
# called www-data, on CentOS it's usually apache. | |
usermod -a -G www-data example; | |
# Set up a password for this user. | |
passwd example; | |
) | |
su - example | |
cd docroot | |
cp sites/default/default.settings.php sites/default/settings.php | |
# Temporarily give the web server write permissions to settings.php | |
chgrp www-data sites/default/settings.php | |
chmod g+w sites/default/settings.php | |
# Create the directory. | |
mkdir sites/default/files | |
# Now set the group to the Apache group. -R means recursive, and -v means | |
# verbose mode. | |
chgrp -Rv www-data sites/default/files | |
chmod 2775 sites/default/files | |
chmod g+w -R sites/default/files | |
chmod 444 sites/default/settings.php | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment