Lots of permissions errors, should the entire site be set to www-data?
You should never give the files directory 777 permissions unless your workin on a local machine. Still then it is bad practice.

Every file in the system needs to be readable by the system user your webserver is using. Every directory should be readable, writable and executable by the same user. The same could be said for the webserver group.

I always set the user to my local user and the group to a group that is readable by my user account &amp; the webserver account. The files directory (and his subdirectories) could be set to a simple 775 so the user and the group have permissions to it. All other users should only be able to read &amp; execute the directory.
As for the files inside the files directory, they should be readable and writable to the local user and the webserver group &amp; only readable for all other users. They should be set to 664.

The same could be said about your private directory, which I just noticed in your error post.