This seems to work:


sudo gpasswd -a <user> www-data
chmod -R g+wxs /var/www