Troubleshooting Blank Pages in IIS7: Missing Logs and File Access Issues


2 views

When IIS7 serves blank pages for all file types (.html, .png, .css, .txt) and fails to generate log files in C:\inetpub\logs, we're typically dealing with one of these underlying issues:

// Example PowerShell command to check IIS module installations
Get-WindowsFeature -Name Web-*

The first culprit is often file system permissions. The IIS_IUSRS group needs:

icacls "C:\inetpub\wwwroot" /grant IIS_IUSRS:(OI)(CI)(RX)
icacls "C:\inetpub\logs" /grant IIS_IUSRS:(OI)(CI)(F)

Missing or misconfigured handler mappings can cause the blank page syndrome:

// Web.config example for static content
<configuration>
  <system.webServer>
    <handlers>
      <add name="StaticFile" path="*" verb="*" 
           modules="StaticFileModule" 
           resourceType="Either" 
           requireAccess="Read" />
    </handlers>
  </system.webServer>
</configuration>

For missing HTTP logs, verify these services are running:

sc query W3SVC
sc query HTTPFilter

When remote machines also see blank pages, test with:

telnet server_ip 80
GET /test.html HTTP/1.1
Host: yourdomain.com

If basic fixes fail, try these diagnostic commands:

netsh http show urlacl
appcmd list config /section:httpLogging
wevtutil qe System "/q:*[System[Provider[@Name='Microsoft-Windows-IIS']]]"

In extreme cases, verify these registry keys:

reg query HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters
reg query HKLM\SOFTWARE\Microsoft\InetStp

When IIS7 fails to serve any file types (.html, .png, .css, .txt) and shows blank pages while simultaneously missing log files in C:\inetpub\logs, we're likely dealing with multiple configuration issues. The empty wmsvc directory suggests deeper permission or service problems.

# PowerShell check for running services
Get-Service -Name W3SVC, WAS

# Verify HTTP.sys registration
netsh http show urlacl

# Check IIS feature installation
Get-WindowsFeature Web-Server, Web-Http-Errors

1. Handler Mappings: Missing or incorrect handler mappings for static files

<configuration>
  <system.webServer>
    <handlers>
      <add name="StaticFile" path="*" verb="*" 
           type="System.Web.StaticFileHandler" />
    </handlers>
  </system.webServer>
</configuration>

2. Logging Configuration: The %windir%\system32\inetsrv\config\applicationHost.config should contain:

<site name="Default Web Site" id="1">
  <logFile directory="C:\inetpub\logs" />
</site>

Run these commands to reset permissions:

# Grant IIS_IUSRS full control to content
icacls "C:\inetpub\wwwroot" /grant "IIS_IUSRS:(OI)(CI)F"

# Reset log directory permissions
icacls "C:\inetpub\logs" /grant "IIS_IUSRS:(OI)(CI)F"
icacls "C:\inetpub\logs" /grant "NETWORK SERVICE:(OI)(CI)F"

Enable failed request tracing by adding to web.config:

<system.webServer>
  <tracing>
    <traceFailedRequests>
      <add path="*">
        <traceAreas>
          <add provider="ASP" verbosity="Verbose" />
          <add provider="ASPNET" areas="Infrastructure,Module,Page" verbosity="Verbose" />
          <add provider="ISAPI Extension" verbosity="Verbose" />
          <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications" verbosity="Verbose" />
        </traceAreas>
        <failureDefinitions statusCodes="200-999" />
      </add>
    </traceFailedRequests>
  </tracing>
</system.webServer>

After making changes, always restart IIS completely:

iisreset /restart /noforce