我有一个站点/应用程序要加载到IIS中。文件夹的根目录包含web.config和index.asp。子文件夹是asp、scripts、style、image。
我在IIS中添加add Web site,定义到index.asp所在位置的物理路径,分配IP地址作为我尝试的本地主机的主机名和IP,并将其留空。当我点击浏览网站时,我收到HTTP 500内部服务器错误。IIS正在运行,网站已在“管理网站”菜单中启动。
如果我编写了一个简短的index.html hello world页面并将其设置为默认文档,它会显示ok。当我将默认文档改回index.asp时,我再次得到500错误。
有没有人能给我一个提示,告诉我如何继续?
这是我的web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<identity impersonate="true" />
</system.web>
<system.webServer>
<defaultDocument>
<files>
<add value="index.asp" />
</files>
</defaultDocument>
</system.webServer>
</configuration>发布于 2016-03-19 10:39:22
这充其量只是一个猜测,因为500可以表示没有子状态代码的任何东西。这可能是由于配置继承造成的。index.asp已经在服务器级别的默认文档列表中。通过添加index.asp,当配置继承被展平到有效配置中时,可能会导致唯一的嘿冲突。
建议:
在正上方添加一个元素,然后重试。否则,我们将需要获取该500的子状态代码以获取更多信息。IIS日志通常在sc-substatus中包含子状态。
生成的配置
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<identity impersonate="true" />
</system.web>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.asp" />
</files>
</defaultDocument>
</system.webServer>
</configuration>如果这是可行的,那么它最初适用于index.html的原因是因为index.html不在默认文件列表中。
附加说明
我能想到的另一件事是启用模拟。如果您在集成管道模式下运行应用程序池,则需要关闭集成模式配置验证。更多信息可在此处找到:Integrated Pipeline mode configuration validation.
新生成的配置
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<identity impersonate="true" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="False" />
<defaultDocument>
<files>
<clear />
<add value="index.asp" />
</files>
</defaultDocument>
</system.webServer>
</configuration>https://stackoverflow.com/questions/36079236
复制相似问题