Skip to content

Instantly share code, notes, and snippets.

@solancer
Created July 27, 2016 10:53
Show Gist options
  • Star 59 You must be signed in to star a gist
  • Fork 40 You must be signed in to fork a gist
  • Save solancer/879105abb05eb7f13ce23e822ed70dd6 to your computer and use it in GitHub Desktop.
Save solancer/879105abb05eb7f13ce23e822ed70dd6 to your computer and use it in GitHub Desktop.
Correct permissions for /var/www/html
// Adding current user to www-data
sudo adduser $USER www-data
//change ownership to user:www-data and
sudo chown $USER:www-data -R /var/www/html
sudo chmod u=rwX,g=srX,o=rX -R /var/www/html
// change file permissions of existing files and folders to 755/644
sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \;
sudo find /var/www/html -type f -exec chmod g=rws "{}" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment