Friday, March 2, 2007

managing IIS and WebDAV

Configuring IIS for WebDAV


If you want to understand what WebDAV is see this article What is Web Distributed Authoring and Versioning (WebDAV)


The following steps are required to configure WebDav for use with Internet Information Server.



  • Create a directory to be used as the WebDav folder inside your web site.
  • Assign the relevant NTFS file permissions so that a user can do what they need, Read Files, Write Files, Delete Files etc..
  • Assign the relevant IIS directory permissions so that the user can view, read, and change files and attributes.

Create a directory to be used as the WebDav folder.


You can create either a physical directory in the web site physical path or a virtual directory for the WebDAV folder.



Assign the relevant NTFS file permissions


Since you will be having people upload to the WebDAV folder you have created and these people will be able to potentially edit your documents you need to protect the folder and files. Setting the NTFS permissions will be dependant on how the WebDAV folder will be used.


If you leave the default NTFS permissions then the special NT Security Group: Everyone will have Full Control access to the files. This means that anyone can upload and download, edit and delete the files.


Assign the relevant IIS directory permissions


The simplest method is to create your physical directory using Windows Explorer and then Right Click and select Properties. When the properties dialog opens select the Web Sharing tab.



Select the web site to host this directory in the Share on drop down list.



Then select the option Share this folder, this will then open a dialog to edit the alias. (Using this method will create a virtual directory)



Note: The following are required settings for WebDAV to work correctly, configure these settings in the Edit Alias dialog.



  • Read

  • Write
  • Directory browsing

If you do not have these settings configured you may see the WebDAV folder but not be able to do anything such as saving a document or seeing any documents.


If using the Internet Service Manager to configure the Virtual Directory properties you should see the following:



Security Warning: You should set the execute permissions to NONE so that a user can not upload an ASP Script or Executable File and then proceed to have it execute on the server.



WebDAV Clients


You can access a WebDAV publishing directory through one of the Microsoft products described in the following list or through any other client that supports the industry standard WebDAV protocol.



  • Windows 2000/XP/.NET connects to a WebDAV server through the Add Network Place Wizard and displays the contents of a WebDAV directory as if it were part of the same file system on your local computer. Once connected, you can drag and drop files, retrieve and modify file properties, and do many other file-system tasks as if it was a real directory.
  • Internet Explorer 5+ connects to a WebDAV directory and lets you do the same file-system tasks as you can through the Windows Explorer but through a web browser.
  • Office 2000/XP can create, publishes, edit, and save documents directly into a WebDAV directory through any application in the Office Suite.


Testing your WebDav folder using IE


Navigate to your physical WebDAV folder using Windows Explorer and create a new Microsoft Word Document or place an existing document into that folder.



To open the WebDAV folder using Internet Explorer requires that you use the [File]-[Open] dialog and select the Open As Web Folder option as shown below.



 



If you forget to open the WebDAV folder using the [File]-[Open] dialog you will get a standard web page as shown below (Directory Browsing Enabled)



When you correctly open the WebDAV folder using the [File]-[Open] dialog method you can Dbl-Click on the Microsoft Word document to Edit it.




When Microsoft Word opens you may see a small dialog as shown above - this is Microsoft Word downloading your document.



You can now edit the document as you normally would. When you save the document the changes are stored on the web server.

No comments: