アプリケーション プールの既定値 <applicationPoolDefaults>

  • 概要
  • 互換性
  • セットアップ
  • 方法
  • 構成
  • サンプル コード

※本ページに挿入されている画像をクリックすると、画像全体が別ウィンドウで表示されます。

概要

<applicationPools> コレクションの <applicationPoolDefaults> コレクションでは、Web サーバー上のすべてのアプリケーション プールの既定値が構成されます。

: <applicationPoolDefaults> コレクションに既定値が明示的に定義されていない場合は、IIS 7.0 スキーマの既定値が継承されます。また、既定値は個々のアプリケーション プールの設定によって上書きされます。

互換性

  IIS 7.0 IIS 6.0
注意 <applicationPoolDefaults> は IIS 7.0 で新たに導入された要素です。

<applicationPoolDefaults> 要素は、IIS 6.0 IIsApplicationPools メタベース プロパティの一部に代わるものです。

セットアップ

<applicationPools> コレクションは、IIS 7.0 の既定のインストールに含まれています。

方法

アプリケーション プールの既定値を設定する方法

  1. タスク バーで [スタート] ボタンをクリックし、[管理ツール] をポイントして [インターネット インフォメーション サービス (IIS) マネージャー] をクリックします。

  2. [接続] ウィンドウで、当該サーバー名を展開し、[アプリケーション プール] をクリックします。

  3. [操作] ウィンドウで [プリケーション プールの既定値の設定] をクリックします。

    拡大

  4. [アプリケーション プールの既定値] ダイアログ ボックスで、必要なオプションを指定します。

    拡大

  5. 設定が完了したら、[OK] をクリックします。

構成

属性

属性 説明
autoStart オプションの Boolean 属性。

true の場合、アプリケーション プールを作成したとき、または IIS の起動時に、そのアプリケーション プールを自動的に起動するように World Wide Web 発行サービス (W3SVC) に指示します。

既定値は true です。
enable32BitAppOnWin64 オプションの Boolean 属性。

true の場合、64 ビット バージョンの Windows を実行するコンピューター上で 32 ビットのアプリケーションを実行できるようになります。

既定値は false です。
managedPipelineMode オプションの enum 属性。

管理コンテンツへの要求の処理に適用する要求処理モードを指定します。

managedPipelineMode 属性には、次のいずれかの値を指定できます。既定値は Integrated です。

--------------------------------------------------------

値: Classic

説明:

  • アプリケーション プールで、IIS と ASP.NET の別々の要求処理パイプラインを使用することを指定します。この設定は、ASP.NET 1.1 アプリケーション、および統合 (Integrated) モードでは動作しない ASP.NET 2.0 アプリケーションに適用できます。
  • 数値は 1 です。

値: Integrated

説明:

  • アプリケーション プールで IIS と ASP.NET の統合要求処理パイプラインを使用することを指定します。この設定は、ASP.NET 2.0 アプリケーションにのみ適用できます。
  • 数値は 0 です。
managedRuntimeVersion オプションの string 属性。

アプリケーション プールで使用する .NET Framework バージョンを指定します。

managedRuntimeVersion 属性には、次のいずれかの値を指定できます。既定値は v2.0 です。
値                      説明 
--------       --------------------------------------------------------
v1.1           アプリケーション プールで .NET Framework バージョン 1.1 を使用することを指定します。 
v2.0           アプリケーション プールで .NET Framework バージョン 2.0 を使用することを指定します。
name 必須の string 属性。

サーバー上のアプリケーション プールの一意の名前を指定します。
queueLength オプションの unit 属性。

キューに書き込む、アプリケーション プールに対する要求の上限数を HTTP.sys に指示します。

このプロパティの設定値を超えると、IIS はそれ以降の要求をエラー 503 によって拒否します。loadBalancerCapabilities の設定が true の場合、エラー 503 で要求を拒否する代わりに、接続を終了します。

既定値は 1000 です。

子要素

要素 説明
cpu CPU 関係と CPU アクションを構成します。
falure アプリケーション プールで障害が発生したときに実行するアクションを構成します。
processModel アプリケーション プールのプロセス管理属性を構成します。
recycling アプリケーション プールのリサイクルを構成します。

構成サンプル

次の構成サンプルでは、すべてのアプリケーション プールの既定の ID を組み込みの Network Service アカウントに設定し、アプリケーション プールをリサイクルするまでの要求数の既定値を 200 に設定しています。

<applicationPools>
   <add name="DefaultAppPool" />
   <applicationPoolDefaults>
      <processModel identityType="NetworkService" />
      <recycling>

         <periodicRestart requests="200" />
      </recycling>
   </applicationPoolDefaults>
</applicationPools>

サンプル コード

次の例では、アプリケーション プールの既定の設定として、アプリケーション プールが自動的に起動し、バージョン 2.0 の .NET 環境を使用し、統合されたパイプラインを使用するように構成しています。

AppCmd.exe

appcmd.exe set config -section:system.applicationHost/applicationPools /applicationPoolDefaults.autoStart:"True" /commit:apphost

appcmd.exe set config -section:system.applicationHost/applicationPools /applicationPoolDefaults.managedRuntimeVersion:"v2.0" /commit:apphost

appcmd.exe set config -section:system.applicationHost/applicationPools /applicationPoolDefaults.managedPipelineMode:"Integrated" /commit:apphost

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 applicationPoolsSection = config.GetSection("system.applicationHost/applicationPools");

         ConfigurationElement applicationPoolDefaultsElement = applicationPoolsSection.GetChildElement("applicationPoolDefaults");
         applicationPoolDefaultsElement["autoStart"] = true;
         applicationPoolDefaultsElement["managedRuntimeVersion"] = @"v2.0";
         applicationPoolDefaultsElement["managedPipelineMode"] = @"Integrated";

         serverManager.CommitChanges();
      }
   }
}

VB.NET

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

Class Sample
   Shared Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration
      Dim applicationPoolsSection As ConfigurationSection = config.GetSection("system.applicationHost/applicationPools")
      Dim applicationPoolDefaultsElement As ConfigurationElement = applicationPoolsSection.GetChildElement("applicationPoolDefaults")
      applicationPoolDefaultsElement("autoStart") = True
      applicationPoolDefaultsElement("managedRuntimeVersion") = "v2.0"
      applicationPoolDefaultsElement("managedPipelineMode") = "Integrated"
      serverManager.CommitChanges()
   End Sub
End Class

JavaScript

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

var applicationPoolsSection = adminManager.GetAdminSection("system.applicationHost/applicationPools", "MACHINE/WEBROOT/APPHOST");
var applicationPoolDefaultsElement = applicationPoolsSection.ChildElements.Item("applicationPoolDefaults");
applicationPoolDefaultsElement.Properties.Item("autoStart").Value = true;
applicationPoolDefaultsElement.Properties.Item("managedRuntimeVersion").Value = "v2.0";
applicationPoolDefaultsElement.Properties.Item("managedPipelineMode").Value = "Integrated";

adminManager.CommitChanges();

VBScript

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

Set applicationPoolsSection = adminManager.GetAdminSection("system.applicationHost/applicationPools", "MACHINE/WEBROOT/APPHOST")
Set applicationPoolDefaultsElement = applicationPoolsSection.ChildElements.Item("applicationPoolDefaults")
applicationPoolDefaultsElement.Properties.Item("autoStart").Value = True
applicationPoolDefaultsElement.Properties.Item("managedRuntimeVersion").Value = "v2.0"
applicationPoolDefaultsElement.Properties.Item("managedPipelineMode").Value = "Integrated"

adminManager.CommitChanges()