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 部分。

  • 相关阅读:
    构建之法阶段小记七
    构建之法阶段小记六
    构建之法阶段小记五
    构建之法阶段小记四
    构建之法阶段小记三
    短学期知识总结(二)
    短学期知识总结(一)
    《构建之法》第八章自习感想与知识点
    第15组构建之法团队心得
    《构建之法》第七章自习感想与知识点
  • 原文地址:https://www.cnblogs.com/tianma3798/p/4139878.html
Copyright © 2011-2022 走看看