Skip to content

Instantly share code, notes, and snippets.

@phamngsinh
Created May 21, 2016 13:45
Show Gist options
  • Select an option

  • Save phamngsinh/6353a274b394c7bc0fb27c1c4a4e226e to your computer and use it in GitHub Desktop.

Select an option

Save phamngsinh/6353a274b394c7bc0fb27c1c4a4e226e to your computer and use it in GitHub Desktop.
Correct permissions for /var/www
First, you should ensure that your username is included in www-data group. If not, you can add your username as www-data group
sudo adduser $USER www-data
After that, you should change the ownership of /var/www to your username
sudo chown $USER:www-data -R /var/www
Next step, you should change permission to 755 (rwxr-xr-x), not recommend changing permission to 777 for security reason
sudo chmod u=rwX,g=srX,o=rX -R /var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment