Friday, December 18, 2009
IIS 7.0 and HTTP Errors
Recently I have been working with Internet Information Server (IIS) 7.0 and got into a few issues (obviously due to my lack of knowledge :-). I configured an ‘Application’ under the ‘Default Web Site’ but was unable to run it. Adding to it, I only got the following error message which gave no clue of what the problem was:
HTTP Error 500 - Internal Server Error
I unchecked the Show friendly HTTP error messages option in Internet Explorer (you can do so in IE by going to Tools -> Internet Options -> Advanced (tab) -> under Browsing) but to my frustration, this time I got a completely blank screen (no error at all :-). After doing some research, it dawned on me that I had not turned on the HTTP Error feature when I installed IIS 7.0. So I went ahead to install this feature (it is found under Web Server -> Common IIS Features -> HTTP Features -> HTTP Error when installing IIS). With this feature installed, you can see an Error Pages (shown below) icon in IIS Manager.
After turning on the HTTP Error feature, there is one more step needed before you can see the proper error message. In IIS Manager, click on Default Web Site and select the Error Pages feature as shown below:
This will bring you to another screen where you click on Edit Features Settings as shown below:
Next you will see a Edit Error Pages Settings dialog box. Make sure the option Detailed errors for local requests and custom error pages for remote request option is selected as shown below:
Now when I browsed my application, I was delighted to see the error message (had to fix it though :-) as shown below:
Detailed vs. Custom Errors
IIS 7.0 either displays a Custom or a Detailed error message based on the type of request. A ‘Custom Message’ is displayed to a client accessing the website from a remote location. This is a short user-friendly message which doesn’t reveal any information pertaining to the website.
A Detailed error message, on the other hand, is displayed when browsing locally (the same machine). Usually the developer or the admin would need to do that for debugging purpose. This type of error message is more verbose and informative which helps in debugging the application. A detailed message would look like the one shown above.
Hope this was useful. Stay tuned for more...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment