-
-
Save anunay/25d28782200f51cfdb143577b1a88ec1 to your computer and use it in GitHub Desktop.
WordPress file/folder permissions for Amazon EC2 Ubuntu instance
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
#!/bin/bash | |
# Location: Anywhere | |
# Add existing 'ubuntu' user to 'www-data' group | |
sudo usermod -a -G www-data ubuntu; | |
# Set the ownership of the files/directories | |
sudo chown -R www-data:www-data /var/www/html/; | |
# Set group ownership inheritance | |
sudo chmod g+s /var/www/html/; | |
# Set the permissions of the files/directories | |
sudo find /var/www/html/ -type d -exec chmod 755 {} \; | |
sudo find /var/www/html/ -type f -exec chmod 644 {} \; | |
# Give `write` permissions to the group (for editing files via FTP) | |
sudo chmod -R g+w /var/www/html/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment