1) Let's say we want to share files in a directory named /usr/share/myfiles. I created a sub-directory called dav in that directory, and then I ran:
# chmod 775 dav2) Make sure httpd.conf loads the mod_dav modules:
# chgrp apache dav
LoadModule dav_module modules/mod_dav.so3) Create an Apache password file (if you want to use basic authentication) and a user -- let's call it webdav:
LoadModule dav_fs_module modules/mod_dav_fs.so
# htpasswd -c /etc/httpd/conf/.htpasswd webdav
4) Create a virtual host entry in httpd.conf, similar to this one:
Options Indexes FollowSymLinks MultiViews
allow from all
CustomLog share-access.log combined
5) Restart httpd, verify that if you go to http://share.mydomain.com/dav you are prompted for a user name and password, and that once you get past the security dialog you can see something like 'Index of /dav'.
Now it's time to configure your Windows client to see the shared WebDAV resource. On the Windows client, either:
- go to "My network connections" and add a new connection, or
- go to Windows Explorer->Tools->Map Network Drive, then click on "Signup for online storage or connect to a network server"
- Click Next, then select "Choose another network location", then click Next.
- For "Internet or network address", set http://share.mydomain.com/dav. At this point you'll be prompted for a user name/password; specify the ones you defined above.
- After mapping the resource, you should be able to read/write to it.
Sometimes the Windows dialog asking for a user name and password will say "connecting to share.mydomain.com" and will keep asking you for the user name/password. The dialog is supposed to show the text you set in AuthName (DAV in my case). If it doesn't, click Cancel, then try again. You can also try to force HTTP basic authentication (as opposed to Windows authentication, which is what Windows tries to do) by specifying http://share.mydomain.com:80/dav as the URL. See also this entry on the WebDAV Wikipedia page.