【问题标题】:DefaultDocument suddenly not working on IIS7DefaultDocument 突然无法在 IIS7 上运行
【发布时间】:2011-01-05 01:55:53
【问题描述】:

我有一个在 IIS7 上运行了大约 2 个月的网站。我们将默认文档设置为在用户访问没有页面的域时加载 default.asp 页面。今天早上突然,我收到错误,默认文档不会加载。如果我键入 default.asp,文件加载就好了。

错误信息:
模块:DefaultDocumentModule
通知:ExecuteRequestHandler
处理程序:静态文件
错误代码:0x80070002

这是我的 applicationhost.config 中的一部分:

<system.webServer>

    <asp>
        <cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" />
    </asp>

    <defaultDocument enabled="true">
        <files>
            <clear />
            <add value="Default.asp" />
            <add value="Default.htm" />
            <add value="index.htm" />
            <add value="index.html" />
            <add value="iisstart.htm" />
        </files>
    </defaultDocument>

    <directoryBrowse enabled="false" />

    <globalModules>
        <add name="UriCacheModule" image="%windir%\System32\inetsrv\cachuri.dll" />
        <add name="FileCacheModule" image="%windir%\System32\inetsrv\cachfile.dll" />
        <add name="TokenCacheModule" image="%windir%\System32\inetsrv\cachtokn.dll" />
        <add name="HttpCacheModule" image="%windir%\System32\inetsrv\cachhttp.dll" />
        <add name="StaticCompressionModule" image="%windir%\System32\inetsrv\compstat.dll" />
        <add name="DefaultDocumentModule" image="%windir%\System32\inetsrv\defdoc.dll" />
        <add name="DirectoryListingModule" image="%windir%\System32\inetsrv\dirlist.dll" />
        <add name="ProtocolSupportModule" image="%windir%\System32\inetsrv\protsup.dll" />
        <add name="HttpRedirectionModule" image="%windir%\System32\inetsrv\redirect.dll" />
        <add name="ServerSideIncludeModule" image="%windir%\System32\inetsrv\iis_ssi.dll" />
        <add name="StaticFileModule" image="%windir%\System32\inetsrv\static.dll" />
        <add name="AnonymousAuthenticationModule" image="%windir%\System32\inetsrv\authanon.dll" />
        <add name="RequestFilteringModule" image="%windir%\System32\inetsrv\modrqflt.dll" />
        <add name="CustomErrorModule" image="%windir%\System32\inetsrv\custerr.dll" />
        <add name="HttpLoggingModule" image="%windir%\System32\inetsrv\loghttp.dll" />
        <add name="RequestMonitorModule" image="%windir%\System32\inetsrv\iisreqs.dll" />
        <add name="IsapiModule" image="%windir%\System32\inetsrv\isapi.dll" />
        <add name="IsapiFilterModule" image="%windir%\System32\inetsrv\filter.dll" />
        <add name="CgiModule" image="%windir%\System32\inetsrv\cgi.dll" />
        <add name="FastCgiModule" image="%windir%\System32\inetsrv\iisfcgi.dll" />
        <add name="ManagedEngine" image="%windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness32" />
        <add name="ConfigurationValidationModule" image="%windir%\System32\inetsrv\validcfg.dll" />
        <add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" />
        <add name="RewriteModule" image="%SystemRoot%\system32\inetsrv\rewrite.dll" />
        <add name="ManagedEngineV4.0_32bit" image="C:\Windows\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
        <add name="ManagedEngineV4.0_64bit" image="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
        <add name="WebDAVModule" image="%SystemRoot%\system32\inetsrv\webdav.dll" />
        <add name="WindowsAuthenticationModule" image="%windir%\System32\inetsrv\authsspi.dll" />
    </globalModules>

我还验证了这些模块物理上存在于磁盘上。我不知道这台服务器上的任何变化,默认文档肯定一直在工作到昨天。服务器是带有 IIS 7.0 的 Windows Server 2008 x64。

我已回收应用程序池、启动服务器、删除并重新输入默认文档。该错误看起来像是找不到默认文档模块..

我还能尝试什么?

【问题讨论】:

  • 您是否尝试过运行进程监视器technet.microsoft.com/en-us/sysinternals/bb896645 然后重新启动 IIS 并访问该页面?这应该向您显示它尝试读取和失败的确切路径。 (如您所知,0x80070002 == ERROR_FILE_NOT_FOUND。)
  • 我正在查看进程监视器,但那里有很多.. 我不知道该看什么。你能帮我吗?我为 Process Name =“w3wp.exe”设置了一个过滤器,结果不是“SUCCESS”。仍然每秒获得数百次点击。这是在生产网络服务器上。我应该过滤一个操作,还是有其他方法来限制,以便我知道要寻找什么?
  • BTW - 看起来 iis 在每个请求的末尾添加了一个 \web.config ?这正常吗?我看到了我尝试使用 default.asp 访问的路径,但就在它访问该页面之前,它尝试了 default.asp\web.config。它对每个文件都执行此操作,并且每次返回 PATH NOT FOUND..

标签: iis-7 document default


【解决方案1】:

我和我的同事整个上午都在追求这个问题,IRC 上的某个人向我们指出了解决方案。事实证明,IIS 在使用默认文档 b/c 时遇到问题,网站根文件夹已被标记为隐藏。显然,当文件夹被隐藏时,默认文档模块找不到它,您会得到上面显示的 ERROR_FILE_NOT_FOUND。
我们通过将 Web 根文件夹设置为“隐藏”来验证开发服务器上的这种行为,并且果然得到了默认文档的相同错误。移除了 Hidden 属性,默认文档加载正确。

我今天看到很多关于此的问题,但没有人发布适合我们问题的答案。我要感谢 IRC 上的任何人!并希望这将有助于其他人在此处发布。

【讨论】:

    猜你喜欢
    • 2018-12-13
    • 1970-01-01
    • 1970-01-01
    • 2021-03-11
    • 2021-03-02
    • 2019-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多