全局模块列表为空

Microsoft.Windows.InternetInformationServices.6.2.The.Global.Modules.list.is.empty (Rule)

Knowledge Base article:

摘要

通过 Internet Information Services (IIS) 8,开发人员可轻松配置本机和托管的代码模块,这些模块用于处理向 Web 服务器发出的请求。为使工作进程可以加载模块,必须正确配置这些模块。正确的模块配置要求模块具有唯一名称和有效类型或路径。被管理的模块可以指定是否仅为对 ASP.NET 应用程序或被管理处理程序的请求调用它们。在指定对象之后,此设置可优化性能。

解决方法

定义全局模块

为使 IIS 成功处理请求,必须至少在 ApplicationHost.config 文件的 globalModules 部分定义一个全局模块。模块定义必须包含模块的唯一名称属性以及可指定 .dll 文件(包含全局模块)的文件系统路径的图像属性。

将全局模块定义添加到 ApplicationHost.config

若要通过记事本将全局模块定义添加到 ApplicationHost.config,请执行以下操作:

全局模块定义示例

<globalModules>

   <add name="AccessCheckModule"

        image="D:\Windows\system32\inetsrv\checkacc.dll"

        preCondition=""

   />

</globalModules>

要详细了解 globalModules 部分,请参阅 IIS 8: 为 globalModules 添加元素(IIS 设置架构)

Element properties:

TargetMicrosoft.Windows.InternetInformationServices.6.2.WebServer
CategoryAlert
EnabledTrue
Event_ID2298
Event SourceMicrosoft-Windows-IIS-W3SVC-WP
Alert GenerateFalse
RemotableTrue
Event LogApplication

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
WA WriteAction Microsoft.Windows.Server.IIS.6.2.GenerateAlertAction.SuppressedByDescription Default

Source Code:

<Rule ID="Microsoft.Windows.InternetInformationServices.6.2.The.Global.Modules.list.is.empty" Enabled="true" Target="Microsoft.Windows.InternetInformationServices.6.2.WebServer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-IIS-W3SVC-WP</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>2298</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="Microsoft.Windows.Server.IIS.6.2.GenerateAlertAction.SuppressedByDescription">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.InternetInformationServices.6.2.The.Global.Modules.list.is.empty.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>