2013-12-09 6 views
2

Я получаю некоторые ошибки на моем классическом веб-сайте asp. Когда веб-сайт работает в первый раз, он иногда выполняет внутреннюю ошибку сервера. Тогда обновление исправит его. Я решил проверить мои журналы IIS, чтобы узнать, в чем проблема, но я не могу ее интерпретировать. Вот строка журналаВнутренняя ошибка сервера 500 w/Журнал IIS

2013-12-09 15:29:00 xx.xx.xx.xx GET/|37|80070005|Access_is_denied.__ 80 - xx.xxx.xx.xx Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/31.0.1650.63+Safari/537.36 500 0 0 702 
+0

'Access_is_denied'? – admdrew

+0

На этой странице рассказывается, как включить полезные сообщения об ошибках в Classic ASP http://www.chestysoft.com/asp-error-messages.asp – John

ответ

2

Как насчет настройки пользовательских страниц для дескрипторов 500 и 500 100 ошибок?

  1. Создать какую-нибудь папку, скажем D: \ InetPub \ Web01 \ Err \ Добавить пользователя IUSR_Web01 с разрешения записи

  2. В IIS для веб-сайта Web01 (образец для IIS 6.0) enter image description here

  3. Put следующий код в файле 500.asp и 500100.asp

    Option Explicit 
    Response.Buffer = True 
    Response.Expires = -1 
    Response.ExpiresAbsolute = #Jan 31,2000 12:30:00# 
    
    Response.Clear 
    
    Dim FS, TF, N, ASPErr 
    N = Now 
    
    Set ASPErr = Server.GetLastError() 
    
    Set FS = CreateObject ("Scripting.FileSystemObject") 
    Set TF = FS.CreateTextFile ("D:\InetPub\1click.lv\Err\500 " & "Error" & Right ("0" & Year (N), 4) & Right ("0" & Month (N), 2) & Right ("0" & Day (N), 2) & "_" & Right ("0" & Hour (N), 2) & Right ("0" & Minute (N), 2) & Right ("0" & Second (N), 2) & ".txt", True, False) 
    TF.Write MyErrorInfo (ASPErr, False, False, "1click.lv", "") 
    TF.Close 
    Set FS = Nothing 
    
    Response.Write MyErrorInfo (ASPErr, True, True, "1click.lv", "[email protected]") 
    Err.Clear 
    

Функция:

Function MyErrorInfo (ASPErr, AsHTML, ShowContactInfo, WebTitle, AdminEmail) 
    Dim Result 
    Result = "" 
    If AsHTML = True Then 
     Result = Result & "<html><head><title>Error occur</title></head><body><font face=Verdana size=2>" 
     If (ShowContactInfo = True) Then 
      Result = Result & "<p align=center>" 
      Result = Result & "<font size=4>" 
      Result = Result & "<font color=""#008000"">" & WebTitle & "</font><br>" 
      Result = Result & "<font color=""#800000"">500 Error occur</font><br>" 
      Result = Result & "Please contact us by email at <a href=""mailto:" & AdminEmail & """>" & AdminEmail & "</a> and inform about this error<br><br>" 
      Result = Result & "Thank you for your support!" 
      Result = Result & "</font>" 
      Result = Result & "</p>" 
     End If 
     Result = Result & "<hr>" 
     Result = Result & "Error number: <b>" & ASPErr.Number & "</b><br>" 
     Result = Result & "Error source: <b>" & ASPErr.Source & "</b><br>" 
     Result = Result & "Error description: <b>" & ASPErr.Description & "</b><br>" 
     Result = Result & "Error line: <b>" & ASPErr.Line & "</b><br>" 
     Result = Result & "Client IP: <b>" & Request.ServerVariables ("REMOTE_ADDR") & "</b><br>" 
     Result = Result & "Client Browser: <b>" & Request.ServerVariables ("HTTP_USER_AGENT") & "</b><br>" 
     Result = Result & "Client Referer: <b>" & Request.ServerVariables ("HTTP_REFERER") & "</b><br>" 
     Result = Result & "Path: <b>" & Request.ServerVariables ("PATH_INFO") & "</b><br>" 
     Result = Result & "Request method: <b>" & Request.ServerVariables ("REQUEST_METHOD") & "</b><br>" 
     Result = Result & "Request FORM: <b>" & Request.Form & "</b><br>" 
     Result = Result & "Request QUERY: <b>" & Request.QueryString & "</b><br>" 
     Result = Result & "<hr>" 
     Result = Result & "</font></body></html>" 
    Else 
     Result = Result & WebTitle & vbCrLf 
     Result = Result & "Error number: " & ASPErr.Number & vbCrLf 
     Result = Result & "Error source: " & ASPErr.Source & vbCrLf 
     Result = Result & "Error description: " & ASPErr.Description & vbCrLf 
     Result = Result & "Error line: " & ASPErr.Line & vbCrLf 
     Result = Result & "Client IP: " & Request.ServerVariables ("REMOTE_ADDR") & vbCrLf 
     Result = Result & "Client Browser: " & Request.ServerVariables ("HTTP_USER_AGENT") & vbCrLf 
     Result = Result & "Client Referer: " & Request.ServerVariables ("HTTP_REFERER") & vbCrLf 
     Result = Result & "Path: " & Request.ServerVariables ("PATH_INFO") & vbCrLf 
     Result = Result & "Request method: " & Request.ServerVariables ("REQUEST_METHOD") & vbCrLf 
     Result = Result & "Request FORM: " & Request.Form & vbCrLf 
     Result = Result & "Request QUERY: " & Request.QueryString & vbCrLf 
    End If 
    MyErrorInfo = Result 
End Function  
Смежные вопросы