To set up permissions on /var/www where your files are served from by default:
sudo addgroup webmasters # If you have multiple users that need to manage the server.
sudo adduser $USER webmasters # Add your current user to the webmasters group
sudo chown -R root:webmasters /var/www
sudo find /var/www -type f -exec chmod 664 {} \;
sudo find /var/www -type d -exec chmod 775 {} \;