WebDAV <webdav>

概要

<webdav> 要素には、インターネット インフォメーション サービス (IIS) 7 用に Web 分散オーサリングとバージョン管理 (WebDAV) を構成する設定が含まれています。 WebDAV は、インターネットベースのオープン標準であり、HTTP および HTTPS 接続経由で Web サイトを編集できるようにします。 WebDAV には、ファイル転送プロトコル (FTP) よりも優れた利点があります。最も顕著な利点は、セキュリティ オプションが多いことと、すべての通信に 1 つの TCP ポートを使用できることです。

互換性

バージョン メモ
IIS 10.0 <webdav> 要素は、IIS 10.0 では変更されませんでした。
IIS 8.5 <webdav> 要素は、IIS 8.5 では変更されませんでした。
IIS 8.0 <webdav> 要素は IIS 8.0 では変更されませんでした。
IIS 7.5 <webdav> 要素は、IIS 7.5 の機能として付属しています。
IIS 7.0 <webdav> 要素は、IIS 7.0 用の別個のダウンロードである WebDAV 7.0 で導入されました。
IIS 6.0 該当なし

Note

WebDAV 7.0 および WebDAV 7.5 モジュールは、IIS 7.0 とは別にリリースされ、次の URL からモジュールをダウンロードしてインストールする必要がありました。

https://www.iis.net/expand/WebDAV

Windows 7 および Windows Server 2008 R2 では、WebDAV 7.5 モジュールは IIS 7.5 の機能として付属しているため、WebDAV のダウンロードは必要なくなりました。

段取り

Web サーバーの WebDAV 発行をサポートするには、WebDAV モジュールをインストールする必要があります。 そのためには、次のステップに従います。

Windows Server 2012 または Windows Server 2012 R2

  1. タスク バーで [サーバー マネージャー]をクリックします。
  2. [サーバー マネージャー] で、[管理] メニューをクリックし、[役割と機能の追加] をクリックします。
  3. 役割と機能の追加ウィザードで、[次へ] をクリックします。 [インストールの種類] を選択し、[次へ] をクリックします。 対象サーバーを選択し、[次へ] をクリックします。
  4. [サーバーの役割] ページで、[Web サーバー (IIS)][Web サーバー][HTTP 共通機能] の順に展開し、[WebDAV 発行] を選択します。 次へ をクリックします。
    Screenshot of the Server Roles page with the WebDAV option being highlighted.
  5. [機能の選択] ページで、[次へ] をクリックします。
  6. [インストール オプションの確認] ページで、[インストール] をクリックします。
  7. [結果] ページで、 [閉じる]をクリックします。

Windows 8 または Windows 8.1

  1. [スタート] 画面で、ポインターを左下隅まで移動し、[スタート] ボタンを右クリックし、[コントロール パネル] をクリックします。
  2. [コントロール パネル][プログラムと機能] をクリックし、[Windows の機能の有効化または無効化] をクリックします。
  3. [インターネット インフォメーション サービス][World Wide Web サービス][HTTP 共通機能] を順に展開して、[WebDAV 発行] を選択します。
    Screenshot of the Windows Features dialog box with a focus on the WebDAV Publishing folder within the Internet Information Services folder.
  4. OK をクリックします。
  5. 閉じるをクリックします。

Windows Server 2008 R2

  1. タスク バーで [スタート] をクリックし、[管理ツール] をポイントして、[サーバー マネージャー] をクリックします。
  2. [サーバー マネージャー] 階層ウィンドウで [ロール] を展開し、[Web サーバー (IIS)] をクリックします。
  3. [Web サーバー (IIS)] ウィンドウで、[役割サービス] セクションまでスクロールし、[役割サービスの追加] をクリックします。
  4. [役割サービスの追加] ウィザードの [役割サービスの選択] ページで、[HTTP 共通機能] を展開し、[WebDAV 発行] を選択して [次へ] をクリックします。
    Screenshot of the Add Role Services Wizard with a focus on the WebDAV Publishing option.
  5. [インストール オプションの確認] ページで、[インストール] をクリックします。
  6. [結果] ページで、 [閉じる]をクリックします。

Windows 7

  1. タスク バーで、[スタート][コントロール パネル] の順にクリックします。
  2. [コントロール パネル][プログラムと機能] をクリックし、[Windows の機能の有効化または無効化] をクリックします。
  3. [インターネット インフォメーション サービス][World Wide Web サービス][HTTP 共通機能] の順に展開します。
  4. [WebDAV 発行] を選択し、[OK] をクリックします。
    Screenshot of the Turn Windows features on or off wizard with a focus on the WebDAV Publishing folder within the World Wide Web Services and Common H T T P folders.

Windows Server 2008 または Windows Vista

操作方法

WebDAV 発行を有効にする方法

  1. インターネット インフォメーション サービス (IIS) マネージャーを開きます。

    • Windows Server 2012 または Windows Server 2012 R2 を使用している場合:

      • タスク バーで、[サーバー マネージャー] をクリックし、[ツール][インターネット インフォメーション サービス (IIS) マネージャー] の順にクリックします。
    • Windows 8 または Windows 8.1 を使用している場合:

      • Windows キーを押しながら文字 X を押し、[コントロール パネル] をクリックします。
      • [管理ツール] をクリックし、[インターネット インフォメーション サービス (IIS) マネージャー] をダブルクリックします。
    • Windows Server 2008 または Windows Server 2008 R2 を使用している場合:

      • タスク バーで、[スタート] ボタンをクリックし、[管理ツール][インターネット インフォメーション サービス (IIS) マネージャー] の順にクリックします。
    • Windows Vista または Windows 7 を使用している場合:

      • タスク バーで、[スタート][コントロール パネル] の順にクリックします。
      • [管理ツール] をダブルクリックし、[インターネット インフォメーション サービス (IIS) マネージャー] をダブルクリックします。
  2. [接続] ウィンドウで、サーバー名を展開してから、WebDAV 発行を有効にするサイト、アプリケーション、またはディレクトリに移動します。

  3. [ホーム] ウィンドウで、[WebDAV オーサリング規則] をダブルクリックします。
    Screenshot of the I I S Manager's Home pane with a focus on the WebDAV Authoring Rules application shortcut.

  4. [操作] ウィンドウで、[WebDAV の有効化] をクリックします。
    Screenshot of the I I S Manager screen's Actions pane with a focus on the Enable WebDAV option.

Note

WebDAV 発行を有効にしたら、ユーザーまたはグループがコンテンツをサーバーに発行する前に、オーサリング規則を追加する必要があります。 オーサリング規則を作成する方法の詳細については、authoringRules トピックを参照してください。


WebDAV オーサリング規則を追加する方法

  1. インターネット インフォメーション サービス (IIS) マネージャーを開きます。

    • Windows Server 2012 または Windows Server 2012 R2 を使用している場合:

      • タスク バーで、[サーバー マネージャー] をクリックし、[ツール][インターネット インフォメーション サービス (IIS) マネージャー] の順にクリックします。
    • Windows 8 または Windows 8.1 を使用している場合:

      • Windows キーを押しながら文字 X を押し、[コントロール パネル] をクリックします。
      • [管理ツール] をクリックし、[インターネット インフォメーション サービス (IIS) マネージャー] をダブルクリックします。
    • Windows Server 2008 または Windows Server 2008 R2 を使用している場合:

      • タスク バーで、[スタート] ボタンをクリックし、[管理ツール][インターネット インフォメーション サービス (IIS) マネージャー] の順にクリックします。
    • Windows Vista または Windows 7 を使用している場合:

      • タスク バーで、[スタート][コントロール パネル] の順にクリックします。
      • [管理ツール] をダブルクリックし、[インターネット インフォメーション サービス (IIS) マネージャー] をダブルクリックします。
  2. [接続] ウィンドウで、サーバー名を展開してから、ディレクトリの参照を有効にするサイト、アプリケーション、またはディレクトリに移動します。

  3. [ホーム] ウィンドウで、[WebDAV オーサリング規則] をダブルクリックします。
    Screenshot of the Default Web Site Home screen's Home pane with a focus on the WebDAV Authoring Rules shortcut.

  4. [操作] ウィンドウで、[オーサリング規則の追加] をクリックします。
    Screenshot of the WebDav Authoring Rules screen's Actions pane with a focus on the Add Authoring Rule option.

  5. [オーサリング規則の追加] ダイアログで、次のオプションを指定します。

    • [以下へのアクセスを許可]: オーサリング規則をすべてのコンテンツ タイプに適用するか、許可する特定のコンテンツ タイプを指定するかを指定します。
    • [このコンテンツへのアクセスを許可する対象]: オーサリング規則をすべてのユーザー、特定のグループまたは役割、もしくは特定のユーザーのいずれに適用するかを指定します。
    • [アクセス許可]: オーサリング規則で、指定したコンテンツ タイプとユーザーに対して [読み取り][書き込み]、または [ソース] のどのアクセスを許可するかを指定します。
      Screenshot of the Add Authoring Rule dialog box.
  6. OK をクリックします。

構成

<webdav> 要素は、ApplicationHost.config ファイルにグローバル、サイト、およびディレクトリの各レベルで構成できます。 Web.config ファイルの WebDAV 設定は無視されます。

属性

なし。

子要素

要素 説明
authoring 省略可能な要素です。

WebDAV オーサリングの構成設定を指定します。
authoringRules 省略可能な要素です。

WebDAV 発行のオーサリング規則を指定します。 これらの規則では、ユーザーまたはグループのコンテンツ タイプとオーサリング アクセス許可を指定します。
globalSettings 省略可能な要素です。 WebDAV モジュールのグローバル設定を指定します。

構成サンプル

次の例では、既定の Web サイトのサンプル <webdav> 要素を表示します。 この例では、既存のオーサリング規則を消去し、管理者グループに対して 1 つの規則を追加し、WebDAV オーサリングを有効にし、非表示ファイルを許可することを指定し、WebDAV ロックを有効にし、ロック プロバイダーを指定し、WebDAV プロパティを有効にし、プロパティ マッピングの既定の XML 名前空間を指定します。

<location path="Default Web Site">
   <system.webServer>
      <webdav>
         <authoringRules defaultAccess="none" allowNonMimeMapFiles="true" defaultMimeType="text/plain">
            <clear />
            <add roles="administrators" path="*" access="Read, Write, Source" />
         </authoringRules>
         <authoring enabled="true" requireSsl="false">
            <fileSystem allowHiddenFiles="true" />
            <locks enabled="true" lockStore="webdav_simple_lock" requireLockForWriting="false" />
            <properties allowAnonymousPropfind="false" allowInfinitePropfindDepth="false" allowCustomProperties="true">
               <clear />
               <add xmlNamespace="*" propertyStore="webdav_simple_prop" />
            </properties>
         </authoring>
      </webdav>
   </system.webServer>
</location>

次の例では、WebDAV サーバーのサンプル <globalSettings> 要素を示します。 この例では、ロックとプロパティのシンプルな組み込みプロバイダーを定義し、サーバーの WebDAV ロックを有効にします。

<system.webServer>
      <webdav>
         <globalSettings>
            <propertyStores>
               <add name="webdav_simple_prop" image="%windir%\system32\inetsrv\webdav_simple_prop.dll" />
            </propertyStores>
            <lockStores>
               <add name="webdav_simple_lock" image="%windir%\system32\inetsrv\webdav_simple_lock.dll" />
            </lockStores>
         </globalSettings>
         <authoring>
            <locks enabled="true" lockStore="webdav_simple_lock" />
         </authoring>
      </webdav>
   </system.webServer>

サンプル コード

次の例では、既定の Web サイトの WebDAV オーサリングを有効にし、WebDAV オーサリングに SSL が不要になるようにサイトを構成します。

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /enabled:"True" /requireSsl:"False"  /commit:apphost

Note

AppCmd.exe を使用してこれらの設定を構成する場合は、commit パラメーターを必ず apphost に設定する必要があります。 これにより、ApplicationHost.config ファイルの適切な場所セクションに構成設定がコミットされます。

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();

         ConfigurationSection authoringSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site");
         authoringSection["enabled"] = true;
         authoringSection["requireSsl"] = false;

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration

      Dim authoringSection As ConfigurationSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site")
      authoringSection("enabled") = True
      authoringSection("requireSsl") = False

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site");
authoringSection.Properties.Item("enabled").Value = true;
authoringSection.Properties.Item("requireSsl").Value = false;

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site")
authoringSection.Properties.Item("enabled").Value = True
authoringSection.Properties.Item("requireSsl").Value = False

adminManager.CommitChanges()

次の例では、WebDAV クライアントが IIS MIME マップに表示されていないファイルを発行できるように WebDAV オーサリング規則を構成し、"管理者" グループへの読み取り、書き込み、およびソース アクセスを許可する単一のオーサリング規則を追加します。

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoringRules /allowNonMimeMapFiles:"True" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoringRules /+"[roles='administrators',path='*',access='Read, Write, Source']" /commit:apphost

Note

AppCmd.exe を使用してこれらの設定を構成する場合は、commit パラメーターを必ず apphost に設定する必要があります。 これにより、ApplicationHost.config ファイルの適切な場所セクションに構成設定がコミットされます。

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();

         ConfigurationSection authoringRulesSection = config.GetSection("system.webServer/webdav/authoringRules", "Default Web Site");
         authoringRulesSection["allowNonMimeMapFiles"] = true;

         ConfigurationElementCollection authoringRulesCollection = authoringRulesSection.GetCollection();

         ConfigurationElement addElement = authoringRulesCollection.CreateElement("add");
         addElement["roles"] = @"administrators";
         addElement["path"] = @"*";
         addElement["access"] = @"Read, Write, Source";
         authoringRulesCollection.Add(addElement);

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration

      Dim authoringRulesSection As ConfigurationSection = config.GetSection("system.webServer/webdav/authoringRules", "Default Web Site")
      authoringRulesSection("allowNonMimeMapFiles") = True

      Dim authoringRulesCollection As ConfigurationElementCollection = authoringRulesSection.GetCollection

      Dim addElement As ConfigurationElement = authoringRulesCollection.CreateElement("add")
      addElement("roles") = "administrators"
      addElement("path") = "*"
      addElement("access") = "Read, Write, Source"
      authoringRulesCollection.Add(addElement)

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var authoringRulesSection = adminManager.GetAdminSection("system.webServer/webdav/authoringRules", "MACHINE/WEBROOT/APPHOST/Default Web Site");
authoringRulesSection.Properties.Item("allowNonMimeMapFiles").Value = true;

var authoringRulesCollection = authoringRulesSection.Collection;

var addElement = authoringRulesCollection.CreateNewElement("add");
addElement.Properties.Item("roles").Value = "administrators";
addElement.Properties.Item("path").Value = "*";
addElement.Properties.Item("access").Value = "Read, Write, Source";
authoringRulesCollection.AddElement(addElement);

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set authoringRulesSection = adminManager.GetAdminSection("system.webServer/webdav/authoringRules", "MACHINE/WEBROOT/APPHOST/Default Web Site")
authoringRulesSection.Properties.Item("allowNonMimeMapFiles").Value = True

Set authoringRulesCollection = authoringRulesSection.Collection

Set addElement = authoringRulesCollection.CreateNewElement("add")
addElement.Properties.Item("roles").Value = "administrators"
addElement.Properties.Item("path").Value = "*"
addElement.Properties.Item("access").Value = "Read, Write, Source"
authoringRulesCollection.AddElement(addElement)

adminManager.CommitChanges()