How do I setup a WebDAV Server on Windows and link it to odrive?

iis
windows
webdav

#1

How do I setup a WebDAV Server on Windows and link it to odrive?


Windows Server Remote Web Access compatible?
Use a local drive as "the cloud"?
Odrive ftp and utf-8 character encoding in Win 10
Windows network
Support for iCloud
#2

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. :unamused:

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 this is 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.


#3

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”


#4

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”


Some WEBDAV files accessible using odrive, but all work through Windows Explorer
Not allowed files when trying to sync to IIS Webdav
#5

A post was split to a new topic: Not allowed files when trying to sync to IIS Webdav


#6

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”


Not allowed files when trying to sync to IIS Webdav
#8

any compatibility for a win 2008 r2 server?


#9

Hi @nhutwelker,
I have not tested Windows Server 2008r2, but IIS for it (7.5) supports WebDAV. The instructions should be similar.


#10

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


#11

A post was split to a new topic: Link WebDAV server with odrive