Create a symlink for each project to your home directory. Say your project is located at `~/projects/foo` and you want to have it located at /var/www/foo, run:
```bash
sudo ln -sT ~/www/magento2 /var/www/html/magento2
```
If your home directory has no execute bit (descend) set for other (for security reasons), change the group of it to www-data, but set the execute bit only (no read/write). Do the same for the ~/projects folder as it may contain other projects than www. (You don't need sudo if you have previously added your user to the www-data group.)
```bash
sudo chgrp www-data ~ ~/www
chmod 710 ~ ~/www
```
Set the group to www-data on `~/www/magento2` and allow the webserver to read and write to files and files+directories and descend into directories:
```bash
sudo chgrp www-data ~/www/magento2
find ~/www/magento2 -type f -exec chmod 660 {} \;
find ~/www/magento2 -type d -exec chmod 2770 {} \;
```
Even safer: use 640 and 2750 by default and manually chmod files and directories that need to be writable by the webserver user. The setgid bit should be added only if you want every newly created file in `~/www/magento2` to be accessible by the group.
From now on, you can access your site at `http://localhost/magento2` and edit your project files in `~/www/magento2`.