How to enable WebDAV in Apache Server 2.2.x – Windows
Web-based Distributed Authoring and Versioning (WebDAV) allow users to read and write server folders and files via HTTP. For more detail, please refer to WebDAV Wiki and WebDAV community.
Here’s a guide to show you how to enable WebDav in Apache Server 2.2.x, under Windows platform. See following steps :
1. Load WebDav in Apache Server
WebDAV comes with Apache server 2.x, you just need to enable it. Edit “%APACHE_PATH%/conf/http.conf
“, uncomment the following load and include statements.
File : http.conf
LoadModule alias_module modules/mod_alias.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule setenvif_module modules/mod_setenvif.so
# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf
2. Create User & Password for WebDAV
For WebDAV authentication access, issue this command :
htdigest -c "%APACHE_INSTALLED_PATH%/user.passwd" DAV-upload admin
See sample output :
C:\Program Files\Apache Software Foundation\Apache2.2\bin>htdigest -c "C:/Program Files/Apache Softw
are Foundation/Apache2.2/user.passwd" DAV-upload admin
Adding password for admin in realm DAV-upload.
New password: ********
Re-type new password: ********
It means, create an user “admin” with password “given by user” and stored it in file – “%APACHE_INSTALLED_PATH%/user.passwd
“, under realm “DAV-upload”.
3. Configure WebDAV folder
Created a “sites” folder under “%APACHE_PATH%/sites
“. Edit “%APACHE_PATH%/extra/httpd-dav.conf
” , add following content :
File : httpd-dav.conf
Alias /sites "C:/Program Files/Apache Software Foundation/Apache2.2/sites"
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/sites">
Dav On
Order Allow,Deny
Allow from all
AuthType Digest
AuthName DAV-upload
Options Indexes
AuthUserFile "C:/Program Files/Apache Software Foundation/Apache2.2/user.passwd"
AuthDigestProvider file
# Allow universal read-access, but writes are restricted
# to the admin user.
<LimitExcept GET OPTIONS>
require user admin
</LimitExcept>
</Directory>
It means enable the WebDAV access for “sites
” folder, and use “user.passwd
” file for authentication, under realm “DAV-upload
” as well (AuthName DAV-upload
).
4. Restart Apache Server
Done, restart Apache server service. Now, WebDAV service is enabled in your server’s “sites” folder.
If your server ip is 127.0.0.1, then you can WebDAV access your “sites” folder via this URL : “http://127.0.0.1/sites”
5. Verify with WebDAV Client
Download and install bitkinex, a powerful free WebDAV client for Windows. The following figure shows bitkinex connected to a web folder via WebDAV :
For other WebDAV related projects or clients, refer to this site
I am working with XAMPP and I followed all the steps as indicated in the tutorial, however, I could not connect with BitKinex to the WebDAV server. Any idea how to do it?
Any tutorial on how to secure webdav with Basic auth + ssl ?
what if i want to have it open for all, no authentication?
I tried mentioned steps but i am not understating clearly ,please tell me about how to do in xampp server
Hello yong,
i need to create file and copy file into mapped drive ,by the above configuration i can able to read files but not able to write file in to the webdav.
Thanks in Advance
Srikanth.
Hello
Mr Mkyong , i have implemented this configuration and it worked
fine , but i have little doubt . When i was downloading large
file thorugh browser if internet connection is disabled then
there was temporary downloaded file when i was enabling internet
connection the download was restarted not resumed . If i want to
resume the download what are the configuration changes needs to
be implemented.
Regards
Thanks MkYong , I have implemented this configuration and its working , but i am facing a issue, in case when i start downloading a large file and if internet connection is down or is disabled the download creates a temporary file , when i connect with network again the download get restarted there is no resume facility, is there any way i can resume my download in this case. If there is any please specify
Regards
Mayur
I’ve followed you steps by the book, httpd-dav.conf and user.passwd files has been created. Xampp got restarted but I still get the error trying to connect to http://127.0.0.1/sites
”
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
”
Any other thoughts?
Thanks much.
Take into consideration to run the htdigest command with a Admin console, otherwise the file will not be created.
Good article for me!
Big Thank’s
Hi Mkyong,
I tryied the steps mentioned in your article “How to enable WinDav in Apache Server 2.2.x- windows” by i could’nt browse my sites folder using WinDAV after launching Apache.
Even if i have access to the files folder with winDAV, i can’t see the files it contains.
Can you help me with that ?
thx
Check your Apache log file, is there any error messages?
Looks like it’s a matter of defining the DAVLockDB as per the Apache error log I got:
Being myself a very smart ass, I added this in my DAV conf just before the Alias the name of an existing DavLock directory that I created empty (yes, I runz WAMP)
And so happened to work smoothly and flawlessly.