找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 589|回复: 0

GoDaddy windows主机空间500错误之web.config文件

[复制链接]
发表于 2010 年 10 月 2 日 16:16:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×

GoDaddy主机出现500错误的主要原因主要有以下几点:
1.没有设置读写权限
参考:GoDaddy空间如何设置读写权限
2.数据库参数等其他代码等出错
这个情况需要用到web.config文件显示详细错误信息,本教程主要讨论这个
3..net程序需要full trust level,GoDaddy不能支持.
这个问题可以参考:GoDaddy主机iis相关设置教程
GoDaddy .net信任等级对asp.net程序的影响说明
4.其它未知错误
联系GoDaddy官方检查:联系 GoDaddy客服发ticket教程
下面教程主要介绍如何使用web.config文件显示详细的错误信息,而不是单纯500 error
默认情况下.NET程序出现错误,客户端显示以下错误:
引用:
    Server Error in '/mytestapp' Application.
    Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
我们可以通过创建或修改web.config文件使之显示详细的错误:
代码1:
(适用于IIS 6)
引用:
    <!-- Web.Config Configuration File -->
    <configuration>
      <system.web>
        <customErrors mode="Off"/>
      </system.web>
    </configuration>
代码2:Windows IIS7的用户使用下面的代码:
引用:
    <configuration>
        <system.webServer>
            <httpErrors errorMode="Detailed" />
            <asp scriptErrorSentToBrowser="true"/>
        </system.webServer>
        <system.web>
            <customErrors mode="Off"/>
            <compilation debug="true"/>
        </system.web>
    </configuration>
使用web.config文件也可以配置显示错误面
其中的mycustompage.htm是你想设置的错误页面
引用:
    <!-- Web.Config Configuration File -->
    <configuration>
      <system.web>
        <customErrors mode="On"default Redirect="mycustompage.htm"/>
      </system.web>
    </configuration>
Mode 值的意思:
引用:
    RemoteOnly:
    Only users logged on to the console of the server can view the detailed error messages. Remote users will see the generic error page unless the defaultRedirect is defined, in which case the custom page is displayed.
    On: No detailed error messages are shown. The custom error page will be used if it was specified in the defaultRedirect.
    Off: Detailed error messages are shown for remote and local users. Use this value to set the value of mode.
附件是打包后的web.config文件,解压后传到空间.
使用于IIS6的 web.config.zip

适用于IIS7的web.config 文件.zip


Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 2 月 3 日 15:15 , Processed in 0.033518 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表