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

  • 相关阅读:
    函数总结
    python之内置函数,匿名函数
    列表推导式 生成器表达式
    迭代器和生成器函数
    最近练习题
    python----------闭包 、装饰器
    python的逻辑运算符
    python------函数嵌套及作用域链
    python ---------函数
    如何实现负载均衡
  • 原文地址:https://www.cnblogs.com/tianma3798/p/4139878.html
Copyright © 2011-2022 走看看