I added another user that I could use for SFTP and then I added him to ‘www-data’ group.
Then I changed all permissions like so ( as from Ubuntu.com guide: https://help.ubuntu.com/12.04/serverguide/httpd.html ):
sudo find /var/www -type d -exec chmod g=rwxs "{}" \;
sudo find /var/www -type f -exec chmod g=rws "{}" \;
As a result my ‘newuser’ is able to read & write files.
But after running:
ee site create test2.com
I can’t write files with ‘newuser’ in /var/www/test2.com/htdocs’
Exposing www-data to the outside world seems less than ideal. Is there a way for ‘newuser’ to have the correct permissions when a new site is added ?