Diagnosing HTTP 500 errors in Classic ASP

2019-04-29 23:25发布

问题:

I have recently inherited a website written in Classic ASP, and am currently trying to get a sense of the state of things. The website is working in production, however the development environment (hosting on a Windows Server 2003 box) produces an HTTP 500 error when you try to navigate to it.

I realize that HTTP 500 errors just mean that an unexpected server error occurred, and that this also is more than likely the ASP code crashing for one reason or another. I have tried numerous browsers (IE, Firefox, and Chrome) but they all have the same amount of information.

Being primiarly an ASP.NET developer I am use to the yellow screen of death which can be configured to show a stack trace.

So my question is, how do I convince IIS and/or Classic ASP to give me a better hint about what is causing the error?

Update: I should have gone into more detail originally, but here are some of the things I've looked at.

  • I've looked at the event logs (Application, Security, System, etc) and there is nothing relevent there.

  • I have looked at the IIS access logs and I see the access attempts, and just 500 errors. It is even producing 500 errors on favicon.ico

回答1:

If you can't find the offending line by turning off "Show friendly HTTP error messages" as Wayne suggested, then try adding "On Error Resume Next" to the code along with response.write statements. I've found with problems like these, you just have to start going line by line through the code until you find the offensive code.

Just out of curiosity, is Active Server Pages set to allowed in the Web Server extensions in IIS on the dev servers?



回答2:

Have you checked the Application portion of the web server's Event Viewer for error entries?



回答3:

What alex said, also make sure that you turn off "Show friendly HTTP error messages" in Internet Explorer and then browse to the site; that tends to give you a more specific error message (although still generic compared to ASP.NET's stack trace) along with the line number.



回答4:

If you have a global.asa file in your web directory, you could rename the file and try loading the favicon.ico file again. If it loads, the problem lies within the global.asa



回答5:

Clearly an old question, but for what it's worth, if you have access to the development server (direct or remote desktop), you can access the site from there. Localhost requests reveal more debugging information about classic ASP including line numbers.