IIS Modules Overview
Introduction
The IIS 7 and above Web server feature set is componentized into more than thirty independent modules.
A module is either a Win32 DLL (native module) or a .NET 2.0 type contained within an assembly (managed module).
Similar to a set of building blocks, modules are added to the server in order to provide the desired functionality for your applications.
Likewise, all IIS modules can be removed, or replaced with custom modules developed using the IIS C++ APIs, or the familiar ASP.NET 2.0 APIs.
This article describes common IIS module management tasks,
and details each module including its configuration settings and the potential effect a module removal has on the Web server.
The management examples are given using both the graphical IIS Manager and the AppCmd command line tool.
Prerequisites
首先要安装IIS
Getting Started with Modules
In order to add a module to the server, you must perform two steps:
- Install a module on the server (native modules only).
- Enable the module in an application.
The first step registers the module globally with the server, making it available within each server worker process.
It is necessary only for native modules due to the trusted nature of native code, and is available only to administrators.
Note:
A native module has unrestricted access to any resource available to the server worker process, just like an ISAPI filter or extension in previous versions.
Because of this unrestricted access, you should install only native modules that come from a trusted source.
The second step enables the module to execute within a particular application and effectively allows the application administrator to control the server features enabled for the application.
This step allows both installed native modules and managed modules to be enabled for each application.
To Install a Native Module
In order to install a native module, it must be registered with the server using one of the options below:
- Manually editing the IIS configuration store. In IIS 7.5 and later you can use the Configuration Editor in the IIS Manager.
- Using the IIS Manager
- Using the AppCmd.exe command line tool
All three of these options result in the module entry being added to the <globalModules> IIS configuration section, which can be set only at the server level.
To examine the contents of this section, open the root configuration file located in %windir%\system32\inetsrv\config\applicationhost.config, and search for the string "<globalModules>".
After a full IIS installation, this section contains an entry for each of the native modules shipped with IIS, specifying a name and the path to the module DLL:
<globalModules>
<addname="DefaultDocumentModule"image="%windir%\system32\inetsrv\defdoc.dll"/>
<addname="DirectoryListingModule"image="%windir%\system32\inetsrv\dirlist.dll"/>
<add name="StaticFileModule"image="%windir%\system32\inetsrv\static.dll"/>
... </globalModules>
All of these modules are described in detail later in this document.
在IIS Manager中,按照如下步骤可以找到对应的Modules
1.打开IIS,在Features View中,找到Management,然后打开Configuration Editor

2.在Configuration Editor中,点击Search

3.输入globalModules进行搜索

3.1搜索页面,有两种视图,默认为Hierarchy View,直接显示出所有的config文件

FlatView,直接列出config文件,看起来比较直观,一下子就看到有几个文件

4.在第三步定位到globalModules的位置后,关闭搜索界面
5.在Configuration Editor下的Section中找到globalModules

6.在显示出来的Collection上的空白处点击一下,右侧出现浏览按钮。最右侧还有一个EditItems的按钮

7.找到对应的Module就可以进行remove

8.左侧的导航栏,可以选中Site处理Site的config;处理Application的config,需要单独选中Application,然后再选择Config Editor
Enabling a Module for an Application
A module must be enabled before it can provide service for a particular application. In order to enable a native module, it must first be installed on the server (see the previous section, To Install a Native Module).
A managed module does not require installation, and can be enabled directly for each application. This allows applications to include their managed modules directly within the application by registering them in the application's web.config file, and providing the implementation in /BIN or /App_Code directories.
To enable a module, do one of the following:
- Manually edit the IIS configuration store, either globally to enable the module for all applications on the server, or in a particular web.config file located within each application for which you would like to enable this module. In IIS 7.5 or above you can use the Configuration Editor.
- Use the IIS Manager
- Use the AppCmd.exe command line tool
All three of these options add the module entry to the <modules> IIS configuration section, which is can be set at both the server level and application level. Examine the contents of this section by opening the root configuration file located in %windir%\system32\inetsrv\config\applicationhost.config, and searching for the string "<modules>".
Unlike native modules, a managed module does not require adding an entry to the <globalModules> configuration section.
After a full IIS installation, the configuration section contains an entry for each of the modules (both managed and native) that shipped with IIS. The entry indicates that all these modules are enabled by default for all applications on the server. Each entry in this section specifies either the name of a native module that was previously installed on the server, or the name and .NET type of a managed module:
Preconditions
There is another attribute on a module entry called precondition. The IIS core engine uses preconditions to determine when to enable a particular module.
Performance reasons, for example, might determine that you only want to execute managed modules for requests that also go to a managed handler.
The precondition in the following example (precondition="managedHandler") only enables the forms authentication module for requests that are also handled by a managed handler, such as requests to .aspx or .asmx files:
<addname="FormsAuthentication"type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" />
If you remove the attribute precondition="managedHandler", Forms Authentication also applies to content that is not served by managed handlers, such as .html, .jpg, .doc, but also for classic ASP (.asp) or PHP (.php) extensions.
See "How to Take Advantage of IIS Integrated Pipeline" for an example of enabling ASP.NET modules to run for all content.
You can also use a shortcut to enable all managed (ASP.NET) modules to run for all requests in your application, regardless of the "managedHandler" precondition.
To enable all managed modules to run for all requests without configuring each module entry to remove the "managedHandler" precondition, use the runAllManagedModulesForAllRequests property in the <modules> section:
<modules runAllManagedModulesForAllRequests="true"/>
When you use this property, the "managedHandler" precondition has no effect and all managed modules run for all requests.
https://autofaccn.readthedocs.io/en/latest/integration/webforms.html
<system.webServer>
<!-- This section is used for IIS7 -->
<modules>
<add
name="ContainerDisposal"
type="Autofac.Integration.Web.ContainerDisposalModule, Autofac.Integration.Web"
preCondition="managedHandler"/>
<add
name="PropertyInjection"
type="Autofac.Integration.Web.Forms.PropertyInjectionModule, Autofac.Integration.Web"
preCondition="managedHandler"/>
</modules>
</system.webServer>
IIS Modules Overview的更多相关文章
- <modules runAllManagedModulesForAllRequests="true" />(转1)
最近在使用 MVC 开发的时候,遇到一个对我来说“奇怪的问题”,就是使用 BundleTable 进行 CSS.JS 文件绑定,然后使用 Styles.Render.Scripts.Render 进行 ...
- 塞翁失马,焉知非福:由 Styles.Render 所引发 runAllManagedModulesForAllRequests="true" 的思考
最近在使用 MVC 开发的时候,遇到一个对我来说"奇怪的问题",就是使用 BundleTable 进行 CSS.JS 文件绑定,然后使用 Styles.Render.Scripts ...
- AspNet Mvc 路由解析中添加.html 等后缀 出现404错误的解决办法
使用Mvc 有时候我们希望,浏览地址以.html .htm 等后缀名进行结尾. 于是我们就在RouteConfig 中修改路由配置信息,修改后的代码如下 routes.IgnoreRoute(&quo ...
- IIS 7.0 的 ASP.NET 应用程序生命周期概述(转载)
IIS 7.0 的 ASP.NET 应用程序生命周期概述更新:2007 年 11 月本主题介绍在 IIS 7.0 集成模式下运行以及与 IIS 7.0 或更高版本一起运行的 ASP.NET 应用程序的 ...
- Install Typical IIS Workloads
原文 Install Typical IIS Workloads Introduction The IIS 7.0 and above modular architecture is designed ...
- Installing IIS 8.5 on Windows Server 2012 R2
原文 Installing IIS 8.5 on Windows Server 2012 R2 Introduction This document describes how to install ...
- Asp.net core 学习笔记 ( IIS, static file 性能优化 )
更新 : 2019-02-06 最后还是把 rewrite 给替换掉了. 所以 rewrite url 也不依赖 iis 了咯. refer : https://docs.microsoft.com/ ...
- NET项目发布到IIS上报错:HTTP 错误 403.14
NET项目发布到IIS上报错:HTTP 错误 404.0 - Not Found 原因:由于本机开发环境是Net4.5,所以虽然创建项目时选择的是net framework4.5的,但是webconf ...
- iis深入学习资源
iis站点:https://www.iis.net/overview/reliability/richdiagnostictools 感兴趣可以深入学习下iis
随机推荐
- React 第三天
第三天 01:在组件中使用style行内对象并封装样式对象: CmtItem.jsx: import React from 'react' //第一层封装 将样式对象和UI结构分离 // const ...
- PHP通过DOM操作XML
PHP XML操作类DOMDocument属性及方法 注意大小写一定不能弄错. 属性: Attributes 存储节点的属性列表(只读) childNodes 存储节点的子节点列表(只读) dataT ...
- 性能测试中的TPS与HPS
性能测试中的TPS与HPS TPS(Transaction per second) 是估算应用系统性能的重要依据.其意义是应用系统每秒钟处理完成的交易数量.一般的,评价系统性能均以每秒钟完成的技术交易 ...
- LVM的创建与挂载
LVM的诞生: 由于传统的磁盘管理不能对磁盘进行磁盘管理,比如我把/dev/sdb1挂载到了/liu目录下,但是因为数据量过大的原因,此文件系统磁盘利用率已经高达98%,那么我可以直接对这个磁盘进行扩 ...
- python基础6(函数 Ⅰ)
函数是组织好的,可重复使用的,用来实现单一,或相关联功能的代码段 定义 def function_name(args...): function_body #例子 def print_somethin ...
- 1113: [视频]树形动态规划(TreeDP)8:树(tree)(树形dp状态设计总结)
根据最近做的几道树形dp题总结一下规律.(从这篇往前到洛谷 P1352 ) 这几道题都是在一颗树上,然后要让整棵树的节点或边 满足一种状态.然后点可以影响到相邻点的这种状态 然后求最小次数 那么要从两 ...
- 【图灵杯 J】简单的变位词
Description 变位词是指改变某个词的字母顺序后构成的新词.蔡老板最近沉迷研究变位词并给你扔了一道题: 给你一些单词,让你把里面的变位词分组找出来.互为变位词的归为一组,最后输出含有变位词最多 ...
- 【金阳光測试】基于控件核心技术探讨---Android自己主动化系列(2)---2013年5月
第一讲分享了下安卓自己主动化一些概况和一些自己主动化框架现状和技术可以解决什么样的问题. 这次课就深入到android世界里面.遨游.翱翔.深入了解自己主动化測试核心技术. 搞过编程开发的同学听到in ...
- Kali linux 2016.2(Rolling)中metasploit的端口扫描
目前常见的端口扫描技术一般有如下几类: TCP Connect.TCP SYN.TCP ACK.TCP FIN. Metasploit中的端口扫描器 Metasploit的辅助模块中提供了几款实用的 ...
- Android项目实战(五十七):Glide 高斯模糊效果
核心需要高斯模糊的库 compile 'jp.wasabeef:glide-transformations:2.0.1' 针对于3.7的版本 使用方法为: //加载背景, Glide.with(Mus ...