Ubuntu How to Give Permissions to your WWW Folder for Apache

How to Give Permissions to a Folder on Ubuntu Server Apache. Writable Folders

I was struggling with setting permissions to my folder in ubuntu and I found a great link on Digital Ocean with a snippet of code on how to do it. 

sudo chown www-data:www-data /var/www/[new directory]
sudo chmod -R 775 /var/www
sudo usermod -a -G www-data [my username]