星空网 > 软件开发 > ASP.net

IIS部署站点相关经验总结

IIS部署站点相关经验总结

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

C:\Windows\system32> C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regii.exe -ir -enable

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

      3.machineKey : 它默认被配在asp.net 框架级的machine.config(C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config)中, 它默认由.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:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\a59f6e56\410d1464\App_Web_uydhjhqj.5.cs    行: 0 

堆栈跟踪: 

 

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

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

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

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

源错误: 

执行当前 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处于“不允许”状态,

IIS部署站点相关经验总结
把4.0相关的启用就好了。。。

 




原标题:IIS部署站点相关经验总结

关键词:IIS

IIS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

全面介绍国家商标注册的流程与要求:https://www.kjdsnews.com/a/1379821.html
全面介绍国家商标查询的入口点:https://www.kjdsnews.com/a/1379822.html
全面介绍国外商标申请流程图:https://www.kjdsnews.com/a/1379823.html
全面介绍国外商标申请流程及注意事项:https://www.kjdsnews.com/a/1379824.html
全面介绍国外商标申请流程:https://www.kjdsnews.com/a/1379825.html
全面介绍国际商标注册流程及方法:https://www.kjdsnews.com/a/1379826.html
23点聊电商:新质生产力加速数字贸易发展 卓尔智联集团实现营收利润双增长 :https://www.kjdsnews.com/a/1836411.html
南京浦口都有什么好玩的地方 南京浦口都有什么好玩的地方推荐:https://www.vstour.cn/a/363180.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流