How do I setup a WebDAV Server on Windows and link it to odrive?
Update:
Iâve created a better structured and more thorough guide to setting up a WebDAV server on Windows and then syncing with it.
Note: Even if you arenât interested in the syncing part (odrive), this guide will still quickly get you up and running with a functioning WebDAV server, using the first section
Original Post:
Here is how to setup a basic WebDAV server on Windows in about 5 minutes. Tested on Windows 10, Windows 8.1, and Windows 2012R2.
1) Open up a Powershell command prompt as administrator
2) Copy and paste the following command into Powershell and hit enter:
$feats = @("IIS-WebServerRole","IIS-WebServer","IIS-CommonHttpFeatures","IIS-HttpErrors","IIS-Security","IIS-RequestFiltering","IIS-WebServerManagementTools","IIS-DigestAuthentication","IIS-StaticContent","IIS-DefaultDocument","IIS-DirectoryBrowsing","IIS-WebDAV","IIS-BasicAuthentication","IIS-ManagementConsole");foreach ($feat in $feats) {Enable-WindowsOptionalFeature -Online -FeatureName $feat};New-SelfSignedCertificate -DnsName odrive-self-signed -CertStoreLocation cert:\LocalMachine\My;& "$env:windir\system32\inetsrv\InetMgr.exe";
This command will install the IIS modules needed for WebDAV, create a self-signed certificate to allow HTTPS, and launch the IIS Manager
3) Now that the IIS Manager is open, right-click on âDefault Web Siteâ and select âAdd Virtual Directoryâ
Select the location on your computer that you wish to make available via your WebDAV server (under âPhysical pathâ), type âWebDAVâ for the alias, and click âOKâ.
4) Under âDefault Websiteâ select âBindingsâ
Add a binding for https, port 4433, select âodrive-self-signedâ as the SSL certificate, and click âOKâ
Note: There is a bug in IIS that will reject to-spec MOVEs when the standard port is used, which is why I recommend a non-standard port like 4433. However, a workaround was done in the odrive move method to account for this, so it shouldnât be a problem with odrive, but could be for other applications.
Remove the port 80 binding once you have port 4433 in.
5) Click on âSSL Settingsâ under âDefault Web Siteâ
Select âRequire SSLâ, âIgnoreâ for âClient Certificatesâ, and click âApplyâ
6) Click on âAuthenticationâ under âDefault Web Siteâ
Disable âAnonymous Authenticationâ, and enable âBasic Authenticationâ
7) Click on âWebDAV Authoring Rulesâ under âDefault Web Siteâ
Click on âEnable WebDAVâ
Click on âAdd Authoring Ruleâ, select âAll contentâ under âAllow access toâ, select âAll Usersâ under âAllow access to this content toâ, check âReadâ and âWriteâ under âPermissionsâ, and click âOKâ.
8) Click on âRestartâ under âDefault Web Siteâ
9) The final step is to link your WebDAV server to odrive.
The example below is linking to a the server over the LAN because I have not setup external access to this machine. Setting up external access is outside the scope of this write-up, but let me know if you have questions about it.
Make sure port 4433 is specified in âServerâ and âRequire Valid SSL Certificateâ is unchecked. The username and password will be the credentials you use to login to your Windows machine where the WebDAV server is running.
That should be it!
Keep in mind that this is a very basic setup. There are many areas you can dig into to add more users, control granular user access, add storage locations, use your own SSL certificate, integrate different authentication systems (like AD), etcâŚ
Let me know if you encounter any issues with the above instructions. I am hoping it allows folks to install and use WebDAV fairly easily.
File Size Upload Limit:
IIS defaults to a 30MB file size limit for uploads. This can be changed to a maximum of 4GB:
Click on âRequest Filteringâ under âDefault Web Siteâ
Click on âEdit Feature Settingsâ
Change the default value in âMaximum allowed content length (Bytes)â to 4294967295
and click âOKâ
MIME Types
By default IIS will block serving content for MIME types that are unknown (flac and mkv, for example). You can add additional MIME Types (and remove others), if you wish to adjust what is supported. It is best practice to create an entry for each additional type you want to add. If you find yourself in a pinch, however, you can add a wildcard mapping until you can sort out the proper individual entries.
Click on âMIME Typesâ under âDefault Web Siteâ
Click on âAddâ
Add the new MIME Type extension and type and then click âOKâ. In the example below we are adding the wildcard MIME mapping
If you plan to use IFS, odriveâs file splitting technology, you will want to add these two MIME Types:
Extension: â.metaâ
MIME Type: âapplication/octet-streamâ
Extension: â.â
MIME Type: âapplication/octet-streamâ
Special Characters
The default settings should allow all characters that Windows allows, except the â+â character. There is a setting to try to deal with that.
Click on âRequest Filteringâ under âDefault Web Siteâ, select âEdit Feature Settingsâ
Check âAllow double escapingâ
any compatibility for a win 2008 r2 server?
Hi @nhutwelker,
I have not tested Windows Server 2008r2, but IIS for it (7.5) supports WebDAV. The instructions should be similar.
yup! just cant use the power shell you provided, you need to download MakeCert.exe via the Microsoft Windows SDK for Windows 7 and .NET Framework 4 which can be downloaded at https://www.microsoft.com/en-us/download/details.aspx?id=8279
Hello There,
I am trying to setting up WebDAV on IIS server i am getting a confusion in creating Virtual directory can someone please help me in this issue.
I am trying to setup WebDav to link to local drive. Managed it all the way to linking the WebDav server to odrive. I get the error messag: Cannot browse WebDAV. Please check your network connection or manage your proxy settings. I dont know what to enter as the server path. Where do I find that?
Hi @verheijp,
The path will be your server name/ip and port with the alias path you specified when setting up the WebDAV folder. (See step #3)
In the example above the alias was set as âWebDAVâ, so the server url was my ip (10.10.10.2) with my port (4433) and my alias (WebDAV). When combined it is https://10.10.10.2:4433/WebDAV
.