Microsoft Developer Network

Documentation | IIS Troubleshooting

Troubleshooting Internet Information Services (IIS)

This article provides a comprehensive guide to diagnosing and resolving common issues encountered with Microsoft Internet Information Services (IIS).

1. Understanding IIS Architecture and Logs

Before diving into troubleshooting, it's crucial to understand the basic components of IIS and where to find critical information. Key components include:

Tip: Ensure that logging is enabled for your websites and application pools. Regularly review IIS logs for patterns of errors, unusual request volumes, or specific error codes.

2. Common IIS Errors and Their Solutions

2.1 HTTP 500 Internal Server Error

This is a generic error indicating that something went wrong on the server. Common causes include:

Troubleshooting Steps:

  1. Enable detailed error messages in IIS (temporarily, for development environments).
  2. Review the Windows Application and System Event Logs for specific error details.
  3. Check your application's logs for exceptions.
  4. Verify file and folder permissions for the IIS user account (e.g., IUSR, Application Pool Identity).

2.2 HTTP 404 Not Found

The requested resource could not be found. This usually means:

Troubleshooting Steps:

  1. Verify the existence and correct path of the requested file/directory on the server.
  2. Check for typos in the URL.
  3. Ensure the Handler Mappings are correctly configured in IIS for the requested file extension.
  4. Review your URL Rewrite rules if applicable.

2.3 HTTP 403 Forbidden

Access to the requested resource is denied. This can occur due to:

Troubleshooting Steps:

  1. Ensure a default document exists in the requested directory or enable Directory Browsing (use with caution).
  2. Verify file and directory permissions for the IIS user.
  3. Check IP Address and Domain Restrictions in IIS.
  4. Examine authentication settings.

2.4 Application Pool Crashes / Recycles

Frequent application pool recycles or crashes can lead to intermittent site unavailability.

Causes:

Troubleshooting Steps:

  1. Configure the application pool to log w3wp.exe failures in the Event Viewer.
  2. Check the application pool's recycling settings (e.g., maximum number of worker processes, idle time-out).
  3. Use tools like Debug Diagnostic (DebugDiag.exe) to capture crash dumps for w3wp.exe.
  4. Monitor server resources (CPU, Memory).

3. Advanced Troubleshooting Tools and Techniques

3.1 IIS Failed Request Tracing

IIS Failed Request Tracing provides detailed, request-level information about problems occurring on your web server. It can trace every step of the request processing pipeline.

To enable:

  1. Open IIS Manager.
  2. Select the site or server.
  3. Double-click "Failed Request Tracing Rules".
  4. Click "Add..." in the Actions pane.
  5. Configure rules based on status codes (e.g., 400-599) or specific event types.

Traced logs are typically found in %SystemDrive%\inetpub\logs\FailedReqLogFiles.

3.2 Sysinternals Tools

Microsoft's Sysinternals suite offers powerful tools for diagnosing system issues:

3.3 Performance Monitoring

Use Performance Monitor (perfmon.exe) to track key IIS counters such as:

4. Best Practices for Preventing Issues

By systematically approaching troubleshooting and leveraging the right tools, you can effectively diagnose and resolve most IIS-related problems.