可以配置 Internet Information Services (IIS) World Wide Web 发布服务 (W3SVC) 来收集性能数据并进行 HTTP 压缩。如果将 W3SVC 配置为执行 HTTP 压缩,则必须在 NTFS 卷中指定有效的压缩目录。
检查压缩目录
IIS 使用可临时缓存静态文件的压缩版本的目录。默认目录为 %SystemDrive%\inetpub\temp\IIS Temporary Compressed Files。为提高文件查找速度和安全性,IIS 8 在此文件夹中为每个应用程序池创建一个子文件夹,且在每个应用程序池文件夹中为每个压缩架构创建一个子文件夹。
通过 IIS 管理器,可指定其他缓存文件夹。在服务器级别进行此设置。缓存文件夹设置存储在 httpCompression 部分的目录属性中,此部分位于 ApplicationHost.config 文件的 system.webServer 下。如果指定的目录位置不存在或无法访问,则将禁用静态压缩。
若要解决此错误,请通过 IIS 管理器检查当前配置的值。如果指定目录不存在,请创建此目录或指定一个真正存在的新位置。若要使用 IIS 管理器,请执行下列步骤。
若要通过 IIS 管理器修改压缩目录位置,请执行以下操作:
单击“开始”,再单击“控制面板”,然后单击“管理工具”。
右键单击“Internet Information Services (IIS) 管理器”并选择“以管理员身份运行”。
在 IIS 管理器“连接”窗格中,单击计算机名。
在“功能视图”中,双击“压缩”。
在“缓存目录:”下,注意已配置的值。
如果配置的目录不存在或无法访问,请创建此目录或指定新目录。
在“操作”窗格中,单击“应用”。
关闭 IIS 管理器。
有关 httpCompression 部分的详细信息,请参阅 IIS 8:httpCompression 元素(IIS 设置架构)。
Target | Microsoft.Windows.InternetInformationServices.6.2.WebServer |
Category | Alert |
Enabled | True |
Event_ID | 2264 |
Event Source | Microsoft-Windows-IIS-W3SVC-WP |
Alert Generate | False |
Remotable | True |
Event Log | Application |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | Microsoft.Windows.EventProvider | Default |
WA | WriteAction | Microsoft.Windows.Server.IIS.6.2.GenerateAlertAction.SuppressedByDescription | Default |
<Rule ID="Microsoft.Windows.InternetInformationServices.6.2.The.directory.specified.for.caching.compressed.content.is.invalid" Enabled="onEssentialMonitoring" 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>2264</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.directory.specified.for.caching.compressed.content.is.invalid.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>