我正在尝试部署一个ASP。网络应用程序。我已经将网站部署到IIS,但当用浏览器访问它时,它显示给我这个:

服务器错误 500 -内部服务器错误。 您正在查找的资源有问题,无法显示。

在摆弄了网页之后。配置,我得到:

由于内部服务器错误,页面无法显示。

我如何才能看到这个服务器错误背后的实际问题?


当前回答

500内部错误 Windows主机错误 Godaddy托管问题

我一直面临着同样的问题,但现在我的问题已经解决了。总是在这个主机上使用,它是有效的。

我也会建议大家做任何你想要在你的网站上做的改变。配置文件。请逐个执行,并在活动域中进行相同的测试,以便您可以找到确切的问题或托管提供商不允许您使用的功能。

<?xml version="1.0"?>

<configuration>
    <system.web>
        <trust level="Medium"/>
        <compilation debug="true" targetFramework="4.5">
            <assemblies>
                <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>

        <httpRuntime targetFramework="4.5" />
        <sessionState mode="InProc" cookieless="false" timeout="90" />
        <authentication mode="Forms">
            <forms loginUrl="default.aspx"  
                   defaultUrl="default.aspx"
                   protection="All"
                   cookieless="UseCookies"
                   slidingExpiration="false"
                   timeout="30"
                   name="aeon.corpusjuris.in" />
        </authentication>

        <customErrors 
            mode="Off" 
            defaultRedirect="errorpage.aspx">

            <error statusCode="403" redirect="errorpage.aspx"/>
            <error statusCode="404" redirect="errorpage.aspx"/>
        </customErrors>

        <!--  <httpModules>
                <add name="HTTPCaching" type="HTTPCaching"/>
            </httpModules>
        -->
    </system.web>

    <runtime>
        <performanceScenario value="HighDensityWebHosting"  />
    </runtime>

    <system.webServer>
        <!--  <modules runAllManagedModulesForAllRequests="true">
                <add name="HTTPCaching" type="HTTPCaching"/>
            </modules>
        -->

        <defaultDocument>
            <files>
                <clear />
                <add value="default.aspx" />
            </files>
        </defaultDocument>

        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>

        <staticContent>
            <clientCache cacheControlCustom="public"
                         cacheControlMaxAge="60:00:00"
                         cacheControlMode="UseMaxAge" />
        </staticContent>
    </system.webServer>

    <system.web.extensions>
         <scripting>
             <webServices>
                 <jsonSerialization maxJsonLength="90000000">
                 </jsonSerialization>
             </webServices>
         </scripting>
    </system.web.extensions>

</configuration>

其他回答

对于那些有这种可能性的人(VPS托管而不是网络托管):

通过远程桌面连接到托管服务器。从远程桌面打开Web浏览器,您将看到错误的详细描述。

你不需要修改web。配置或暴露任何细节给任何人。

对我来说,下面的代码在网上。Config是罪魁祸首。当我删除它时,网站运行正常。

  <staticContent>
    <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
  </staticContent>

如果您正在使用IIS 8.5,可能需要将ApplicationPool ID设置从ApplicationPoolId更改为NetworkService

右键单击有问题的应用程序池,单击“高级设置”,然后向下滚动到ID——它可能会被设置为ApplicationPoolIdentity。单击按钮(..)并从下拉列表中选择NetworkService。

此外,如果是. net 2.0应用程序,请确保在应用程序池中没有引用4.0框架。

我意识到你服务器上的文件和文件夹的权限也很重要。我从linux操作系统上传了我的文件,通常读写权限是有限的。因此,在上传时,权限仍然与本地机器相同。

我有同样的错误,我只是改变了我上传的文件夹的权限,错误就消失了。

希望它能帮助到别人。

我第一次尝试发布并运行一个只提供HTML的非常简单的网站,结果是“页面无法显示,因为发生了内部服务器错误”。

问题:我在Visual Studio中将网站设置为。net 3.5(右键单击网站项目->属性页-> Build),但在Azure中将网站配置为。net 4.0。哦!我在Azure中将其更改为3.5,并且它可以工作。