Windows supports mounting WebDAV shares as drives. WebDAV is a HTTP protocol for file access used by for example SharePoint.
net use Z: http://server/webdav /PERSISTENT:yes /USER:USER PASS
It does however not support basic auth by default (basic auth sends password in cleartext, which is bad). It took me some troubleshooting to figure it out so I thought I’d share my results. You’ll probably need basic knowledge of setting up and troubleshooting Apache sites as I’ve left out some details. See this tutorial on setting up basic WebDAV. The following builds on this tutorial, but adds digest auth in addition. Note that to mount WebDAV on Windows Server you need Desktop Experience feature installed.
First enable digest auth module:
Create the first user:
htdigest -c /var/www/webdav/passwd.dav webdav USER
And edit /etc/apache2/sites-available/default:
Options Indexes MultiViews
allow from all
Alias /webdav /var/www/webdav/mounts
Optional: Under the mounts-folder I wanted to share some SMB shares. I also wanted to combine all shared (multiple disks) into a single folder. Note the file_mode and dir_mode if you want write access. You also need standard web permissions on the folders (same as for any website).
//10.0.0.10/pub1 /mnt/pub1 cifs username=XXX,password=XXX,umask=222 0 0
//10.0.0.10/pub2 /mnt/pub2 cifs username=XXX,password=XXX,umask=222 0 0
//10.0.0.10/pub3 /mnt/pub3 cifs username=XXX,password=XXX,umask=222 0 0
//10.0.0.10/pub_rw /var/www/webdav/mounts/pub_rw cifs username=XXX,password=XXX,file_mode=0676,dir_mode=0676,gid=www-data 0 0
mhddfs#/mnt/pub1,/mnt/pub2,/mnt/pub3 /var/www/webdav/mounts/pub fuse defaults,allow_other 0 0
To combine folders (last line) you need mhddfs installed: apt-get install mhddfs
3 thoughts on “Apache WebDAV setup compatible with Windows”
You mentioned Sharepoint initially, but then talked about Apache – does that mean Sharepoint works with basic auth?
PS I just noticed our internal sites are using http (not https) – wow.
The problem is client side (need client side registry patch to remove restriction), so I’m guessing its not using basic auth.
WebDAV is just the protocol and works on both IIS (SharePoint) and Apache.
Thanks for the clarification.