How to setup a Windows XP compatible WebDAV folder under Apache
NOTE: This HOWTO is specifically for Apache 1.3.x and Windows XP: you'll need to figure out something else for Apache 2.x. During our own transition to Apache 2.x we abandoned AuthDigest, opting instead for AuthBasic plus SSL.
Windows XP is extremely ornery about connecting to WebDAV folders in terms of authentication, unlike Windows 2000, which plays nicely with WebDAV. This page documents what we had to do to get XP to reliable be able to mount a WebDAV folder.
What we are trying to do in this document is set up a password protected WebDAV directory which can be accessed under Windows XP via either the My Network Places ->> Add Network Place method or the Map Network Drive method. See "Accessing a shared (WebDAV) webfolder from Windows XP or 2000" for more information on those methods.
Symptoms
Using either Digest (mod_auth_digest, not mod_digest, which just plain doesn't work anywhere) or Basic authentication, Windows XP seems convinced that it is supposed to be presenting NTLM (LanManager) credentials to the WebDAV server, which are of the form "hostname/username". The WebDAV server is, of course, looking for "username"
You can tell this is happening because your first authentication attempt will fail, and XP will show the password dialog with the Username field filled in as "hostname/username".
Solution
Obtain mod_encoding from http://webdav.todo.gr.jp/download/, compile it up, and put it somewhere Apache can see it. I've done this for our Solaris boxes: you can find mod_encoding.so as /its/software/libexec/apache/mod_encoding.so.
-
Add the following code to your httpd.conf file:
LoadModule encoding_module /its/software/libexec/apache/mod_encoding.so LoadModule headers_module /its/software/libexec/apache/mod_headers.so LoadModule dav_module /its/software/libexec/apache/libdav.so LoadModule auth_module /its/software/libexec/apache/mod_auth.so AddModule mod_encoding.c AddModule mod_headers.c AddModule mod_dav.c AddModule mod_auth.c # # Broken WebDAV for Windows XP # BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully BrowserMatch "Microsoft-WebDAV-MiniRedir/5.1.2600" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS" redirect-carefully <IfModule mod_headers.c> Header add MS-Author-Via "DAV" </IfModule> <IfModule mod_encoding.c> EncodingEngine on NormalizeUsername on </IfModule> -
Next add your DAV directives to httpd.conf. If directory is the directory you wish to DAV-ify (just an example -- modify to suit your needs):
DAVLockDB /path/to/lockfile/DAVLock DAVMinTimeout 600 <Directory "directory"> DAV On AuthType Basic AuthName test AuthUserFile /path/to/passwd/file AuthGroupFile /dev/null Require user test </Directory>Ensure that the directory into which you're writing your lock file (/path/to/lockfile) is writable by the user which runs the httpd process! Here in HSS that is httpd (UID 103) for Solaris and apache (UID 48) for Linux (Need to fix that to be the same on both platforms. CPM 11/04/03)
-
Now populate the passwd file:
htpasswd -c /path/to/passwd/file test
Ensure that the passwd file is readable by the user that runs httpd!
-
Restart httpd, and you should have a working setup.
E-mail help@hss.caltech.edu or call x4073.