title: File permissions; Should my www-folder content be owned by www-data?
body: <p>This might be a noob question, but can't find an answer anywhere.</p>
  
  <p>I have a problem, which <a href="https://stackoverflow.com/questions/3483832/another-file-permissions-problem">Another file permissions problem</a> have helped me to ALMOST solve.</p>
  
  <p>I have created a user in linux (<strong>danny</strong>) which has sudo access.
  I have also created a new group which name ALSO is <strong>danny</strong>, and added the user <strong>danny</strong> to that group. <strong>This group has sudo (root) access.</strong></p>
  
  <p>I have all files and folders in my <strong>www</strong> folder owned by danny/danny group.</p>
  
  <p>I have an image-upload code which is <strong>php</strong>. This code cannot upload images to a folder called "<strong>images</strong>" folder which is under the <strong>www</strong> folder, UNLESS I give the images folder <strong>777</strong> permissions.</p>
  
  <p>So, I have followed the answer on the linked question, and have figured out that the user which the upload-script is run as is "<strong>www-data</strong>".</p>
  
  <p>According to the answer on the link to the other question I posted, I need to add <strong>www-data</strong> to a group... But I am stuck here...</p>
  
  <p>Which group should I add to? What should I do from here?</p>
  
  <p>Any tips are appreciated.</p>
  
  <p>Btw, here is some info about www-data and danny</p>
  
  <pre><code>  id www-data:
    uid=33(www-data) gid=33(www-data) groups=33(www-data)
    id danny
    uid=1000(danny) gid=33(www-data) groups=33(www-data)
  </code></pre>
  
  <p>Thanks and if you need more input, just let me know...</p>