You try to load your classic ASP (Active Server Pages) website and all you can see in your browser is the all too familiar display of 500 Internal Server Error.
This page isn't working WEBSITE is currently unable to handle this request HTTP ERROR 500
What is 500 Internal Server Error
First of all, the 500 Internal Server Error is a very general HTTP status code that indicates something has gone wrong on the web server without any specifics on the exact problem.
This instruction is limited to solving a 500 error on IIS server for classic ASP websites, however some other instructions that’s related to IIS in general will help for troubleshooting IIS server for .NET applications as well.
As 500 Server Error message is very often vague, the task now is to find a more specific error message that will help us further analyze and troubleshoot the issue.
Enable Debugging and Send Errors to Browser
If the website is not in a production environment, the easiest way to do it is to enable the ASP Debugging Properties and send the errors to the browser by following these steps:
Launch Internet Information Services (IIS) Manager and on the left pane, select your ASP website and click on the ASP icon (Configure properties for ASP applications).
Under the ASP window, expand the Debugging Properties and set Enable Client-side Debugging, Enable Server-side Debugging, and Send Errors To Browser to True and click Apply.
Now, when you refresh your ASP website, you will see a more descriptive error message on your browser such as the following example:
System.Xml error '80131509' There is an error in the XML document. /itnota/failed-page.asp, line 289
With this information, you can right away open the file (e.g., itnota/failed-page.asp) and check line number 289. Again, this option is not recommended for a production website that’s still actively used and available for public since it exposes too much information publicly. The ideal way to do it is to replicate your production environment on a staging and try to reproduce the error on a lower environment.
Check IIS Log
Another way to check 500 Internal Server Error for your ASP website is by viewing IIS error logs. This is especially true if your ASP website is a public website.
Where to find the IIS Logs?
By default, the log for your website is stored on %SystemDrive%\inetpub\logs\LogFile, but you should not use this settings for a production environment. Always set a custom path for your logs so your websites are easier to maintain in the long run. If you have a different physical hard drive for logs, even better. Make sure it’s set to Enabled.
For the sake of example, the log files are located in folder D:\Logs\ITNota.com:
From the IIS log example below, the easiest way is to look for a pipe character (“|”) on the date and time when the error happens.
The error message can be broken down into two parts:
The first part indicates the problematic file with its parameters which can be reconstructed by replacing the white space with a question mark (“?”) like so:
The second part which starts with a pipe character (“|”) is the line number that caused the error, the error code, and the error description:
From the above information, we are look at the following information:
Check the affected file by opening it in Visual Studio Code or any IDE.
If you use Visual Studio Code to read and write ASP or VBScript, click here for a way how to colorize your ASP code.