我正在尝试部署一个ASP。网络应用程序。我已经将网站部署到IIS,但当用浏览器访问它时,它显示给我这个:
服务器错误 500 -内部服务器错误。 您正在查找的资源有问题,无法显示。
在摆弄了网页之后。配置,我得到:
由于内部服务器错误,页面无法显示。
我如何才能看到这个服务器错误背后的实际问题?
我正在尝试部署一个ASP。网络应用程序。我已经将网站部署到IIS,但当用浏览器访问它时,它显示给我这个:
服务器错误 500 -内部服务器错误。 您正在查找的资源有问题,无法显示。
在摆弄了网页之后。配置,我得到:
由于内部服务器错误,页面无法显示。
我如何才能看到这个服务器错误背后的实际问题?
当前回答
我意识到你服务器上的文件和文件夹的权限也很重要。我从linux操作系统上传了我的文件,通常读写权限是有限的。因此,在上传时,权限仍然与本地机器相同。
我有同样的错误,我只是改变了我上传的文件夹的权限,错误就消失了。
希望它能帮助到别人。
其他回答
我意识到你服务器上的文件和文件夹的权限也很重要。我从linux操作系统上传了我的文件,通常读写权限是有限的。因此,在上传时,权限仍然与本地机器相同。
我有同样的错误,我只是改变了我上传的文件夹的权限,错误就消失了。
希望它能帮助到别人。
首先,您需要启用并查看web消息的详细错误,因为出于安全原因,这是一个一般性消息,没有提供关于实际发生情况的信息。
有了详细的错误,您可以在这里找到真正的问题。
此外,如果您可以在服务器上运行浏览器,则可以获得有关错误的详细信息,因为服务器识别出您是本地的,并将其显示给您。或者,如果您可以使用事件查看器读取服务器的日志,则还可以看到错误的详细信息。
第6页
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
第7页
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
注意:你可以避免Debug=true。您只需要暂时关闭自定义错误,并获得详细的错误页面。
这可以帮助:如何启用详细的错误消息(从IIS)。
尝试在Debug模式下编译(在Visual Studio中)。如果您处于发布模式,许多URL重写错误将不可用。
图为Visual Studio中的调试选择组合框
对于iis10,除了更改customErrors=Off来显示错误内容外,还有一个额外的步骤要做。
<system.web>
<customErrors mode="Off" />
</system.web>
<system.webServer>
<httpErrors existingResponse="PassThrough" errorMode="Detailed"/>
</system.webServer>
Raul在这个链接中回答了这个问题:关闭IIS8自定义错误
Before changing the web.config file, I would check that the .NET Framework version that you are using is exactly (I mean it, 4.5 != 4.5.2) the same compared to your GoDaddy settings (ASP.Net settings in your Plesk panel). That should automatically change your web.config file to the correct framework. Also notice that for now (January '16), GoDaddy works with ASP.Net 3.5 and 4.5.2. To use 4.5.2 with Visual Studio it has to be 2012 or newer, and if not 2015, you must download and install the .NET Framework 4.5.2 Developer Package. If still not working, then yes, your next step should be enabling detailed error reporting so you can debug it.