zoukankan      html  css  js  c++  java
  • <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 部分。

  • 相关阅读:
    [编程题]多多的数字组合
    mac传输文件到服务器
    git 清除缓存、查看add内容
    go build
    vim编辑器
    Git: clone指定分支
    查看端口占用以及kill
    curl小记录
    Python3.9 malloc error: can’t allocate region
    设计模式-策略模式
  • 原文地址:https://www.cnblogs.com/tianma3798/p/4139878.html
Copyright © 2011-2022 走看看