• <modules>


    1.IIS7里关闭不需要的组件

    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="Profile" />
      <remove name="Session" />
      <remove name="RoleManager" />
      <remove name="FormsAuthentication" />
      <remove name="WindowsAuthentication" />
      <remove name="DefaultAuthentication" />
      <remove name="AnonymousIdentification" />
      <remove name="OutputCache" />
      <remove name="UrlAuthorization" />
      <remove name="FileAuthorization" />
      <remove name="UrlMappingsModule" />
    </modules>
    <handlers>
      <clear />
      <add name="PageHandlerFactory" path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
      <!-- Add custom handlers here -->
      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
    </handlers>
    </system.webServer>

    IIS7方便到可以在web.config里可以控制更多的东西。这些不需要的东西在modules里就那么多,像session那样的需要开了就行。

    handlers里如果要加自定义的,一定要在StaticFileModule前添加。

    2.

    runAllManagedModulesForAllRequests

    在ASP.net中的web.config中,modules的这个属性比较重要。

    由于是在Global.ascx中,如想对每个Request都执行Application_BeginRequest,那么必须要在system.web或system.webServer中的modules中加入此属性:

    <modules runAllManagedModulesForAllRequests="true">

    详情可见:http://learn.iis.net/page.aspx/121/iis-7-and-above-modules-overview/ 中的 Preconditions 部分。

  • 相关阅读:
    php mysqli 查询个门店数据(面向对象)
    php 上锁 概述
    php 小程序渠道推广,转发
    php 微信公众号获取用户信息
    php 小程序获取用户信息
    php 生成小程序二维码
    1、收集日志至指定主题
    hihoCoder 网络流四·最小路径覆盖
    hihocoder1393 网络流三·二分图多重匹配
    hihocoder1398 网络流五之最大权闭合子图
  • 原文地址:https://www.cnblogs.com/tianma3798/p/4139878.html
Copyright © 2020-2023  润新知