Advertisement
R3nd0gg

Apache folder permission

Oct 15th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. SITE_ROOT="/var/www/html/"
  2. sudo chown -R $USER $SITE_ROOT
  3. sudo chgrp -R www-data $SITE_ROOT
  4. sudo find . -type d -exec chmod 0755 {} \;
  5. sudo find . -type f -exec chmod 0644 {} \;
  6. sudo chmod -R g+s $SITE_ROOT
  7.  
  8. # If you need folders to which site needs to write, simply set them like this:
  9. sudo chgrp -R www-data $FOLDER
  10. sudo chmod -R ug+rwx $FOLDER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement