zoukankan      html  css  js  c++  java
  • IIS部署站点相关经验总结

    IIS部署站点相关经验总结

          1.IIS.net4.0安装是有先后顺序的,应该先安装.net framework 4.0,再安装IIS。如果按相反顺序安装的话,IIS中看不到4.0相关的东西,那么只能执行命令启用:

    C:Windowssystem32> C:WINDOWSMicrosoft.NETFrameworkv4.0.30319aspnet_regii.exe -ir -enable

          2. IIS的应用程序池标识有“ApplicatonPoolIdentity,”LocalSystem”,”Local Service”,”Network Service”,默认使用“ApplicatonPoolIdentity,那么如果你连接的是本地的数据库,由于安全的限制,你可能就连接不上,在应用程序池高级设置》进程模型中把应用标识改成”LocalSystem”或许就可以了。

          3.machineKey : 它默认被配在asp.net 框架级的machine.config(C:WindowsMicrosoft.NETFramework64v4.0.30319Config)它默认由.net framework动态生成,在不同的服务器上生成的都不一样,然而集群场景中必须要一样才行,不然在一些加密解密过程中会出现错误:

          4.要注意IIS应用程序池经典模式与集成模式的区别,这个要根据具体场景具体分析。

    案例1: 在负载均衡方式部署时,由于多台服务器上的machineKey不一样,会导致viewstate验证失败。

    “/”应用程序中的服务器错误。 

     

    Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    See http://go.microsoft.com/fwlink/?LinkID=314055 for more information. 

    说明执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

    异常详细信息System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    See http://go.microsoft.com/fwlink/?LinkID=314055 for more information.

    源错误: 

     [没有相关的源行]


    源文件c:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Files oota59f6e56410d1464App_Web_uydhjhqj.5.cs    

    堆栈跟踪: 

    案例2: 应用程序池标识设置不当,导致无法连接机上的.sqlexpress实例

    无法打开登录所请求的数据库 "wygl"。登录失败。
    用户 'IIS APPPOOLielong' 登录失败。

    说明执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

    异常详细信息System.Data.SqlClient.SqlException: 无法打开登录所请求的数据库 "wygl"。登录失败。
    用户 'IIS APPPOOLielong' 登录失败。

    源错误: 

    执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息

    案例3:v4.0相关的ISAP和CGI扩展未启用,导致网站无法使用

    朋友的产品“易隆物业管理系统”出问题了,就联系我帮忙解决。我访问时就遇到下面这个异常信息:

    ============================2015-07-31 00:12:57==============================

     IP:

     Message:要处理此请求,必须在配置中注册 WebResource.axd 处理程序。

     

    <!-- Web.Config 配置文件 -->

     

    <configuration>

        <system.web>

            <httpHandlers>

                <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />

            </httpHandlers>

        </system.web>

    </configuration>

     Stack:   在 System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded, Boolean forSubstitution, IScriptManager scriptManager)

       在 System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager)

       在 System.Web.UI.ClientScriptManager.GetWebResourceUrl(Page owner, Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager)

       在 System.Web.UI.ClientScriptManager.RenderWebFormsScript(HtmlTextWriter writer)

       在 System.Web.UI.Page.RenderWebFormsScript(HtmlTextWriter writer)

       在 System.Web.UI.Page.BeginFormRender(HtmlTextWriter writer, String formUniqueID)

       在 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)

       在 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)

       在 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)

       在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       在 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)

       在 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

       在 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

       在 System.Web.UI.Control.Render(HtmlTextWriter writer)

       在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

       在 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

       在 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

       在 System.Web.UI.Page.Render(HtmlTextWriter writer)

       在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

       在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

       在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

       在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     ====================================END====================================== 

    想了下,是不是应用程序池类型的原因呢,一看应用程序池现在用的是集成,换成经典试试,

    把应用程序池改成经典,然后遇到报错:
    HTTP 错误 404.2 - Not Found
    由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面。
    然后进入IIS7.5的“ISAPI和CGI限制”,一看明白了,asp.net v4.0处于“不允许”状态,


    把4.0相关的启用就好了。。。

  • 相关阅读:
    [CF600E]Lomsat gelral
    [BZOJ3237]连通图
    [CF580D]Kefa and Dishes
    [BZOJ4726]Sabota?
    bzoj2120&&2453 -- 带修改莫队
    bzoj4726 [ POI2017 ] -- 树形DP
    bzoj2809 [ APIO2012 ] -- 主席树
    bzoj4216 -- 分块
    bzoj4173 -- 欧拉函数
    bzoj2982 -- Lucas定理
  • 原文地址:https://www.cnblogs.com/fuhongwei041/p/IIS_ApplicationPoolIdentity.html
Copyright © 2011-2022 走看看