title: How to allow writing to files via Apache and WebDAV
body: <p>I am having trouble understanding how I can get to edit files on a WebDAV setup. I have set up the Auth correctly, as verified by loads of online tutorials, yet there are some files like <code>.htaccess</code> which I can't edit.</p>
  
  <p>The contents of the VirtualHost setup are</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  
          ServerAdmin xxx
          ServerName xxx
  
          DocumentRoot /data/www/vhosts/xxx
          &lt;Directory /data/www/vhosts/xxx&gt;
                  Options Indexes MultiViews
                  AllowOverride None
                  Order allow,deny
                  allow from all
          &lt;/Directory&gt;
  
          &lt;Location /&gt;
                  DAV On
                  AuthType Basic
                  AuthName "WebDAV Access"
                  AuthUserFile /data/www/.htpasswd-webdav
                  Require valid-user
          &lt;/Location&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I've generated the correct username in the file too, and I can log in successfully and see all the files. Like I say, the problem is that certain files are unreadable and unwritable, the main culprits being <code>.htaccess</code> and <code>.gitignore</code>.</p>
  
  <p>I have set the permissions on all files to <code>664</code> and all folders to <code>775</code> and a <code>user:group</code> of <code>xxx:www-data</code>. The reason being that this allows PHP to read/write the files ok, and our remote login user <code>xxx</code> to do the same without permissions issues.</p>
  
  <p>Is there something specific I need to do to allow reading writing to these hidden dot files? I'm completely stumped, as most tutorials I've read are telling me that if I don't set the rights on dot files to <code>root:root</code> then they will be writable. I am using a Mac to connect to the WebDAV service, which runs on Ubuntu, if this makes any difference</p>
  
  <p>Just for clarity, all of the <code>xxx</code> in this question is to hide info.</p>