WebDAV on Windows 7
WebDAV is a great way of accessing files over the Internet. It’s essentially FTP, but not so archaic and fragile. It works well through firewalls, can be encrypted, and is just generally a nice, modern, useful protocol.
I’ll show you a couple WebDAV tricks in a moment, but first, I’m going to show you how to set up WebDAV on your own Windows machine. It’s one of the best ways of accessing files remotely – free, easy, and highly compatible. I’ll assume you’re using Windows 7, because if you’re a tech enthusiast, there’s no reason you should be using anything else at this point. WebDAV works under pretty much everywhere, but it’s not always this easy to set up.
So, the first thing to do is to install IIS, if you haven’t already done so. IIS is included in all versions of Windows 7, although it’s not turned on by default. Click Start, type “Windows features”, and click enter. This will get you to the Windows Features dialog (which you can also access through Add/Remove Programs):
Turn on IIS, and make sure you select at least the following:
- Internet Information Services
- IIS Management Console
- WebDAV Publishing
- Windows Authentication
You might want to read through everything else there and make your own decisions about what you’d like to install. If you don’t know what something is, just leave it off – it’s easy to change later. Then, you’ll need to open port 80 on your router and firewall (assuming you want to access this server from elsewhere on the Internet).
Now, start IIS Manager. You’ll need to configure authentication, so select Default Web Site and double-click the Authentication icon:
Depending on what options you chose earlier, you might have other types of authentication available here (such as basic, Kerberos, or certificate-based). I’d suggest you disable Anonymous and enable Windows authentication.
Next, go to WebDAV Authoring Rules, and click Enable on the right:
This turns on WebDAV for this web. Now, you’ll need to add an authoring rule (essentially, permissions for WebDAV). Click ‘Add Authoring Rule’ from the right, and you’ll see this:
The easiest thing to do here is to select all content, all users, and all permissions. Clearly, you may want to change this to suit your requirements.
Once you click OK, your server will be running WebDAV! This is great if you just want access to the files on your Default web site, but if you want general access to other places on your computer, you’ll want to add some virtual directories. To do this, right-click the Default Web Site, and choose ‘Add New Virtual Directory’:
Type an alias and provide a path to the folder you’d like to share. Then click OK. Just like that, you’ve set up a ‘Share’ under WebDAV.
Now, I’ll show you a great trick for using WebDAV. This will also let us test to see if everything is working properly. Open a command prompt, and type something like this:
net use * http://mobile1/projects
That should map a network drive to your WebDAV folder:
As you can see, it’s a pretty easy way of accessing your files remotely. You get all the rich tools of working with files straight through Windows, and since WebDAV works over simple HTTP, this will work through all but the strictest of firewalls. As this is running through IIS, you can also take full advantage of the rich security and administration tools IIS provides – including HTTPS, if you’re worried about encrypting your transfers (while your password will be encrypted if you use Windows Authentication, the rest of your session is sent in the clear if you choose to use normal HTTP).
By the way… if you have Directory Browsing turned on, you can type that same URL into a browser, authenticate as required, and you’ll see a listing of your files that you can download directly. This might not be as slick as WebDAV, but it’s guaranteed to work everywhere.
Here are some things you may run into trouble with:
- You can’t use Basic authentication with HTTP. This is a good thing: in such a scenario, your password would be sent in plain text. Either use HTTPS or turn on Windows Authentication.
- Don’t forget that IIS runs under an account that won’t have access to certain places (like your desktop) by default, so you may have to adjust file permissions accordingly.
- To use WebDAV, three permission checks will all have to succeed: the WebDAV authoring rule, your IIS permission settings, and your Windows permission settings. If you’re having trouble, start at the bottom and work your way up. Can you access the file through IIS using a browser? If not, you won’t be able to get at the file through WebDAV, either.
Because of the flexibility offered through IIS, you can use this for much more than simply accessing your documents remotely:
- Let others edit a web site you’re hosting.
- Set up a public read only ‘tools’ folder where you can easily get at common tools and documents you find yourself wishing were available on other people’s machines.
- Create a web-accessible team folder, granting read-only access to some users and full access to others.
- Publish web pages from within Microsoft Office! Just choose ‘web page’ as the file type when you click Save, and save the document to a public WebDAV folder.
There’s a tremendous amount of helpful information on WebDAV under IIS 7 at http://learn.iis.net/page.aspx/357/webdav-for-iis-70/ if you want to learn more.
WebDAV: Use it, love it. It doesn’t get much better than this, folks!
Posted by Paul on Thursday, July 02, 2009
Labels: Windows 7
Thank you for a great article. I followed all your steps & setup WebDAV on my Win 7 desktop at home. I installed GoodSync to connect remotely (via Internet) but I am unable to do so. I think the problem might be a simple syntax error & I am hoping you can help me.
For example, if:
IP = 50.50.50.50
Computer name = COMP
WebDAV virtual folder = test (local user has full access)
username = user
password = password
What would the syntax be for me to connect. I have tried various combinations but so far no dice. Also, in your article you mention forwarding port 80 to the local pc (which I have done), but other WebDAV articles mention port 443. Am I supposed to use 443 & not 80?
Here is a screenshot of the error I see when I attempt to connect:
http://i72.photobucket.com/albums/i181/thanasi67/webdav.jpg
Thanks again for the great article & I hope to hear your thoughts :)
Cheers,
For example, if:
IP = 50.50.50.50
Computer name = COMP
WebDAV virtual folder = test (local user has full access)
username = user
password = password
What would the syntax be for me to connect. I have tried various combinations but so far no dice. Also, in your article you mention forwarding port 80 to the local pc (which I have done), but other WebDAV articles mention port 443. Am I supposed to use 443 & not 80?
Here is a screenshot of the error I see when I attempt to connect:
http://i72.photobucket.com/albums/i181/thanasi67/webdav.jpg
Thanks again for the great article & I hope to hear your thoughts :)
Cheers,