If you don't set permissions right, your server will be down. If too restrictive, i.e. your server(e.g nginx or apache) has no write permissions for some things, content won't be served. If too liberal, you will pawned and alot of bad things will maybe happen. Here's how I set the permissions(should be added to playbooks if possible).
There are 2 ways of setting up the permissions:
- Make webserver owner of all files [Recommended]
- Giving yourself ownership
sudo chown -R www-data:www-data /path/to/dir