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: http://dav.mysite.com/Files /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>
ServerAdmin [email protected]
ServerName dav.dav.mysite.com
DocumentRoot /var/www/dav.mysite.com/
UseCanonicalName Off
Alias /Files "/var/www/dav.mysite.com/"
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.mysite.com">
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
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error
ErrorLog /var/log/apache2/dav.dav.mysite.com-error.log
CustomLog /var/log/apache2/dav.dav.mysite.com.log common
ServerSignature Off
</VirtualHost>
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
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.
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.
Here is some more information: https://stackoverflow.com/questions/666553/how-to-avoid-windows-vista-to-do-double-webdav-requests