网站和 Web 应用程序依赖于 Internet Information Services (IIS) 应用程序池的可用性。而 IIS 应用程序池又依赖于 Windows Process Activation Service (WAS)。如果在启动或关闭应用程序池时,WAS 未运行或发生错误,则网站和 Web 应用程序可能不可用。
必须将应用程序池标识设置为有效的帐户,应用程序池才能运行。应用程序池有两种标识类型:内置和自定义。内置帐户是 NetworkService、LocalService 和 LocalSystem。默认值(建议)是 NetworkService。如果设置应用程序池标识为自定义帐户,则你需要确保用户凭证有效,同时用户是 IIS_USRS 组的成员。以下过程介绍了如何设置应用程序池标识,然后重新启动应用程序池。
若要设置应用程序池标识:
单击“开始”,再单击“控制面板”,然后单击“管理工具”。
右键单击“Internet Information Services (IIS) 管理器”并选择“以管理员身份运行”。
在左侧的“连接”窗格中,展开计算机,然后选择计算机名下的“应用程序池”文件夹。
在“功能视图”中,选择应用程序池。在“操作”窗格中,选择“高级设置”...
在“进程模型”下,验证“标识”类型。默认值为 NetworkService。
如果标识类型被设置为特定用户(不是内置帐户的用户),则单击标识名称右侧的 按钮,然后单击“设置”以指定自定义帐户凭证。
如果你指定了自定义用户,则继续下一步;否则,跳至停止并重新启动应用程序池的过程。如果应用程序池标识被设置为自定义用户,则必须添加用户到计算机上的 IIS_USRS 组。
添加特定用户(自定义帐户)到 IIS_USRS 组,请执行以下操作:
依次单击“开始”、“管理工具”、“计算机管理”。
在左窗格中,展开“本地用户和组”。
选择“组”,然后双击 IIS_USRS。
添加你之前为进程模型标识指定的自定义用户。
使用下一个过程中的步骤停止并重新启动 Web 服务。
注意:在添加用户到 IIS_USRS 组后,必须停止并重新启动 Web 服务,新登录权限才会生效。这将停止传输到服务器的所有 Web 流量。
如果你未添加标识到 IIS_USRS 组,则继续执行后续步骤以停止并重新启动应用程序池。
停止并重新启动 Web 服务,请执行以下操作:
打开提升的命令提示符窗口。单击“开始”,指向“所有程序”,单击“附件”,右键单击“命令提示符”,然后单击“以管理员身份运行”。
键入 net stop was /y,然后按 ENTER。
键入 net start was,然后按 ENTER。
键入 net start w3svc,然后按 ENTER。
停止并重新启动应用程序池,请执行以下操作:
打开 IIS 管理器。
在“连接”窗格中,展开服务器节点并单击“应用程序池”。
在“功能视图”中,选择您希望停止并重新启动的应用程序池。
在“操作”窗格中,单击“停止”以停止应用程序池,然后单击“启动”以重新启动应用程序池。
也可使用以下链接重新启动应用程序池:
回收应用程序池
Target | Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool | ||
Parent Monitor | System.Health.ConfigurationState | ||
Category | ConfigurationHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool.EventLogManualReset2StateMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.Windows.InternetInformationServices.6.2.The.identity.of.the.application.pool.is.invalid.Monitor" Accessibility="Public" Enabled="true" Target="Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool" ParentMonitorID="SystemHealth!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.Windows.InternetInformationServices.6.2.ApplicationPool.EventLogManualReset2StateMonitorType" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.Windows.InternetInformationServices.6.2.The.identity.of.the.application.pool.is.invalid.Monitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/EventDescription$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ManualResetEventRaised" MonitorTypeStateID="ManualResetEventRaised" HealthState="Success"/>
<OperationalState ID="ErrorEventRaised" MonitorTypeStateID="ErrorEventRaised" HealthState="Error"/>
</OperationalStates>
<Configuration>
<LogName>System</LogName>
<Expression>
<And>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>^(5021|5057)$</Pattern>
</RegExExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-WAS</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Configuration>
</UnitMonitor>