Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've enabled apache dav module on my site and configured digest authentication for it. Now i'm trying to connect windows drive to it. Command follows:

net use z: /user:username *

then it asks for password. After that drive appears to be connected except for one detail. In server logs I can see strange 401 errors:

xx.xx.xx.xx - - [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files HTTP/1.0" 401 751
xx.xx.xx.xx - username [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files HTTP/1.0" 301 495
xx.xx.xx.xx - - [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files/ HTTP/1.0" 401 751
xx.xx.xx.xx - username [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files/ HTTP/1.0" 207 1175
xx.xx.xx.xx - - [22/Mar/2011:23:05:07 +0000] "PROPFIND /Files HTTP/1.0" 401 751
xx.xx.xx.xx - username [22/Mar/2011:23:05:07 +0000] "PROPFIND /Files HTTP/1.0" 301 495
xx.xx.xx.xx - - [22/Mar/2011:23:05:07 +0000] "PROPFIND /Files/ HTTP/1.0" 401 751
xx.xx.xx.xx - username [22/Mar/2011:23:05:07 +0000] "PROPFIND /Files/ HTTP/1.0" 207 1175

As you can see for any proper digest authenticated request it sends one wrong request

My apache config:

<VirtualHost xx.xx.xx.xx:80>
        DocumentRoot /var/www/
        UseCanonicalName Off

        Alias /Files "/var/www/"

        BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
        BrowserMatch "MS FrontPage" redirect-carefully
        BrowserMatch "^WebDrive" redirect-carefully
        BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
        BrowserMatch "^gnome-vfs/1.0" redirect-carefully
        BrowserMatch "^XML Spy" redirect-carefully
        BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
        BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On

        <Directory "/var/www/">
                Dav On
                Order allow,deny
                Allow from all
                AuthType Digest
                AuthName "DAV-upload"
                AuthDigestDomain /Files/
                AuthDigestProvider file
                AuthUserFile /var/www/webdav.passwd
                Require valid-user

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel error
        ErrorLog /var/log/apache2/
        CustomLog /var/log/apache2/ common
        ServerSignature Off

And it works very-very slowly. Why do you think it sends requests without authentiocation? BTW other webdav clients work properly

P.S. nginx is sitting in front of apache and passing ALL the traffic to it

share|improve this question

Welcome to a huge pain. I had the same problem and figured it out in windows. First thing is go to internet explorer then tools internet options. Go to connections tab and look at I believe lan settings. Here look if "auto detect lan settings" is checked. If so uncheck it. This will fix the speed issues. If you still see problems come back and ill give you some more ideas.

share|improve this answer
OOOOOOMG! You are my hero! – Dmytro Leonenko Mar 23 '11 at 6:50
But 401 errors still exist – Dmytro Leonenko Mar 23 '11 at 6:51
Thanks I try lol. For the 401 errors are they only for this client? If so I would clear all cache in IE including passwords and see if that helps. Or rebuild the profile as a last resort – gdurham Mar 23 '11 at 13:57
Have you tried adding it as a network drive through my computer just make sure to click on use other username/password – gdurham Mar 23 '11 at 14:22
Yes. Just the same behaviour – Dmytro Leonenko Mar 24 '11 at 7:15

I was able to find an answer that this is apparently by design: the authentication challenge is to be on every request. A work around that I implemented is to allow anonymous directory/file listing (PROPFIND requests) and authentication on everything else using Apache config shown below. The speed improvement is significant, for a python project with 21876 files a refresh takes half as long, 11 minutes vs 22 minutes with authentication.

## Development HTTP Site
<VirtualHost *:80>

        # Log file location and settings; logs within project is ok as long as 'links' are made to system 'var/log/apache'
        ErrorLog /var/log/apache2/
        CustomLog /var/log/apache2/ vhost_combined

        # Canonical to always strip www - see:
        RewriteCond %{HTTP_HOST} ^www\.(.+)$
        RewriteRule ^(.*)$ ${SERVER_PROTOCOL}://%1/$1 [R=301,L,NC]

        # Authenticated access for the development site version - because without this Google will find you!
        # Just in case we also prevent serving of the password logins file if it is stored in a serving folder.
        Redirect /apache-logins.htdigest
        <Location />
                DAV On
                DirectoryIndex disabled
                Options +Indexes
                AuthType Digest
                AuthName ""
                # AuthDigestDomain which urls (and any under it) this applies - should match location
                AuthDigestDomain /
                AuthDigestProvider file
                AuthUserFile /srv/www/django/
                # uncomment the LimitExcept to receive a small boost for non caching Windows WebDav client by allowing
                # anonymous directory listing; see
                <LimitExcept PROPFIND>
                    Require valid-user

        # You can further limit processes, threads and set a inactivity-timer so deamon get unloaded
        WSGIDaemonProcess display-name=%{GROUP}
        WSGIScriptAlias / /srv/www/django/

        # Serve static / media files through apache instance and alias/map them to specific urls. to maximize security
        # `Options -Indexes` is enabled to prevent directory listing
        Options -Indexes
        Alias /robots.txt /srv/www/django/
    #Alias /sitemap.xml /srv/www/django/
        Alias /favicon.ico /srv/www/django/
        Alias /media /srv/www/django/
        Alias /static /srv/www/django/


Here is some more information:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.