WWW 服务在尝试保护应用程序池的句柄时出错

Microsoft.Windows.InternetInformationServices.10.0.WWW.service.encountered.an.error.when.it.tried.to.secure.the.handle.of.the.application.pool (Rule)

Knowledge Base article:

摘要

网站和 Web 应用程序依赖于 Internet Information Services (IIS) 应用程序池的可用性。而 IIS 应用程序池又依赖于 Windows Process Activation Service (WAS)。如果在启动或关闭应用程序池时,WAS 未运行或发生错误,则网站和 Web 应用程序可能不可用。

解决方法

设置应用程序池标识并重新启动应用程序池

必须将应用程序池标识设置为有效的帐户,应用程序池才能运行。应用程序池有两种标识类型:内置和自定义。内置帐户是 NetworkService、LocalService 和 LocalSystem。默认值(建议)是 NetworkService。如果设置应用程序池标识为自定义帐户,则你需要确保用户凭证有效,同时用户是 IIS_USRS 组的成员。以下过程介绍了如何设置应用程序池标识,然后重新启动应用程序池。

若要设置应用程序池标识,请执行以下操作:

添加特定用户(自定义帐户)到 IIS_USRS 组,请执行以下操作:

注意: 在添加用户到 IIS_USRS 组后,必须停止并重新启动 Web 服务,以便使新登录权限生效。这将停止传输到服务器的所有 Web 流量。

如果你未添加标识到 IIS_USRS 组,继续执行后续步骤以停止并重新启动应用程序池。

停止并重新启动 Web 服务,请执行以下操作:

停止并重新启动应用程序池,请执行以下操作:

也可使用以下链接重新启动应用程序池:

回收应用程序池

Element properties:

TargetMicrosoft.Windows.InternetInformationServices.10.0.ApplicationPool
CategoryAlert
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.Server.IIS.10.0.WarningAndErrorEventProvider Default
Filter ConditionDetection Microsoft.Windows.InternetInformationServices.10.0.ApplicationPool.EventFilter Default
WA WriteAction Microsoft.Windows.Server.IIS.10.0.GenerateAlertAction.SuppressedByDescription Default

Source Code:

<Rule ID="Microsoft.Windows.InternetInformationServices.10.0.WWW.service.encountered.an.error.when.it.tried.to.secure.the.handle.of.the.application.pool" Enabled="true" Target="Microsoft.Windows.InternetInformationServices.10.0.ApplicationPool" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.Windows.Server.IIS.10.0.WarningAndErrorEventProvider">
<LogName>System</LogName>
</DataSource>
</DataSources>
<ConditionDetection ID="Filter" TypeID="Microsoft.Windows.InternetInformationServices.10.0.ApplicationPool.EventFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>1026</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-IIS-W3SVC</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WA" TypeID="Microsoft.Windows.Server.IIS.10.0.GenerateAlertAction.SuppressedByDescription">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.InternetInformationServices.10.0.WWW.service.encountered.an.error.when.it.tried.to.secure.the.handle.of.the.application.pool.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>