title: Safest way to set up webroot with permissions?
body: <p>first time user of Ubuntu, setting up a web server and am confused on best practices. Should I set it up in var/www/site/public or in home somewhere?</p>
  
  <p>What is the best way to grant permissions? This is what I've found:</p>
  
  <pre><code>sudo adduser www-data (yourgroup)
  
  sudo chgrp (your group) /var/www
  
  sudo chmod –R 775 /var/www       ***( or would 774 be better)***
  
  sudo chmod g+s /var/www
  </code></pre>
  
  <p>This way I could setup a group to add people to at a later date. Can't add files anywhere but in my user folder, I know that's not the right place and I'd like to start off doing everything correctly.</p>