Sorry, I was writing from the phone and was in a hurry, so wanted to respond promptly but keep it short. Now I see it is not clear. I will try to explain.

I just think we should replace:

```
$ chmod -R 777 app/cache
$ chmod -R 777 app/logs
```

with 

```
$ sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
```

And in [Setting up Permissions](http://symfony.com/doc/current/book/installation.html#configuration-and-setup) section it is described how to set this permissions properly.