Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DefaultDocument suddenly not working on IIS7

I have a website which has been running on IIS7 for about 2 months. We have the default documents set up to load a default.asp page when users go to the domain with no page. Suddenly this morning, I am getting errors and the default document will not load. If I type the default.asp, the file loads just fine.

Error Info:
Module: DefaultDocumentModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x80070002

here is a section from my 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>

I have also verified that the modules physically exist on disk. I am not aware of any changes on this server, and the default document has definitely been working up till yesterday. Server is Windows Server 2008 x64 with IIS 7.0.

I've recycled the app pool, booted the server, removed and reentered the default documents. the error looks like it cant find the default document module..

What else can I try?

like image 502
Stephen Avatar asked Jan 21 '23 19:01

Stephen


1 Answers

My coworker and I have been chasing this all morning and someone on IRC pointed us to the resolution. Turns out that IIS was having trouble with the default document b/c the website root folder had gotten marked as Hidden. Apparently, when the folder is Hidden, the default document module cannot find it and you get the ERROR_FILE_NOT_FOUND shown above.
We verified this behavior on a Dev server by setting the web root folder to Hidden and sure enough got the same error for the default document. Removed the Hidden attribute and the default document loads correctly.

I have seen a lot of questions about this today, and no one has posted an answer that fit our problem. I want to say thanks to whoever that was on IRC! And hopefully this will help others to post it here.

like image 125
Stephen Avatar answered Mar 11 '23 02:03

Stephen