Setup WebDAV in Apache2 on SuSE Linux to Support Windows (XP/Vista/7) Clients

Earlier today, a colleague told me that she doesn’t like using my servers because I don’t have FTP setup thus, she couldn’t map my server as a drive. Well, I showed her. I stand firmly against using FTP as any type of web-related solution and thus, decided on WebDAV to address my colleague’s demanding needs.

Initially, I set the virtual host up for Basic Authentication but was unable to get Windows 7 and Windows XP to map the drive. Windows complained that “The network path could not be found.” I tried mapping the drive from both the command line and from Windows Explorer with no luck. Then I read that theWindows webDAV client does not support Basic Authentication. If this server were on my domain, I’d use Kerberos without a second thought, but it’s an Internet web server so that is out of the question. Digest Authentication it is.

I went enable mod_dav, mod_dav_fs, and mod_auth_digest in YaST under Network Services >> HTTP Server >> Server Modules and I restarted the service. I then created the folder /var/davlock, gave it the proper permissions and added the following to httpd.conf

Then I added the new host, to my vhosts.conf file and restarted the service.

Notice AuthUserFile /etc/apache2/.htdigest. That file was created using htdigest2 (or on most other systems, htdigest).

htdigest2 -c /etc/apache2/.htdigest sample acmeuser

The -c switch creates the file, “sample” correlates with the AuthName directive and acmeuser is the username of my demanding colleague. Also take note that the way I used LimitExcept allows all non-webDAV users to have anonymous access to the site, while any webDAV activity requires a username and password.

Next, I mapped a drive in Windows with the two methods I am familiar with. First, via the command line

And then via Windows Explorer (My Computer >> Map Network Drive [be sure to click “Connect Using Different Credentials”]). Both worked flawlessly. And of course, this is all better if you can do it over HTTPS, which I plan to setup when I have time. But for now, my servers are totally in style and ready for use by people who aren’t fans of vi ;).

Chrissy is a Cloud and Datacenter Management & Data Platform MVP who has worked in IT for over 20 years. She is the creator of the popular SQL PowerShell module dbatools, holds a master's degree in Systems Engineering and is coauthor of Learn dbatools in a Month of Lunches. Chrissy is certified in SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in Apache, Linux, Security, Windows
2 comments on “Setup WebDAV in Apache2 on SuSE Linux to Support Windows (XP/Vista/7) Clients
  1. Megan Louviere says:

    Thank you for catering to my needs even though you do not agree with them sometimes! Excellent article.

  2. Kris says:

    Chrissy –
    Will those directives work in a .htaccess file? I’d like to get my Win7 WebClient to talk to my hosting provider’s server. They are using cPanel which has “WebDisk” feature, so I know they support WebDAV somehow; however, they are using LiteSpeed, not Apache. Can I (at least theoretically) put these directives in my .htaccess file and get it to work?

Leave a Reply

Your email address will not be published. Required fields are marked *