Last active
August 8, 2022 08:58
-
-
Save valiantboymaksud/46de0f5414d7f300abb4f89f0ed3205b to your computer and use it in GitHub Desktop.
apache2 folder permission
This file contains hidden or 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
sudo usermod -a -G www-data $USER | |
sudo chown root:root /var/www | |
sudo chmod -R 755 /var/www | |
sudo chown -R www-data:www-data /var/www/* | |
You can do the all the recommended steps in just 3 commands instead of 8 commands: | |
3 commands: | |
sudo chown -R ubuntu:www-data /var/www | |
sudo find /var/www -type d -exec chmod 2750 {} \+ | |
sudo find /var/www -type f -exec chmod 640 {} \+ | |
do the same work as following 8 commands: | |
sudo chgrp -R www-data /var/www | |
sudo find /var/www -type d -exec chmod g+rx {} + | |
sudo find /var/www -type f -exec chmod g+r {} + | |
sudo chown -R ubuntu /var/www/ | |
sudo find /var/www -type d -exec chmod u+rwx {} + | |
sudo find /var/www -type f -exec chmod u+rw {} + | |
sudo find /var/www -type d -exec chmod g+s {} + | |
sudo chmod -R o-rwx /var/www/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment