Error Lumberjack

Warning: Abandoned
This page/script has been classified as abandoned and will no longer be updated. I will keep this page here indefinitely as a reference, but it will no longer be updated and I no longer offer support of any kind regarding content found on this page.

Description

  • Error-Lumberjack (dumb name, i know) is a CGI script allows you to log the Apache errors your site receives (page not found, server error, access denied, etc). It also displays a custom error message for each error. Includes complete administration options.

Download

Terms of Use

  • This script was abandon by me in 2002 and is listed as public domain. I do however reserve full rights to the name.

Instructions

Open error.cgi and set the variables

  • Set the Path to perl. On most systems it's #!/usr/bin/perl but varies by host
  • Set the path to your log file. currently set at "log.txt" but you can be set to anything
  • Set your email and your main page so visitors have a way to get ahold of you and somewhere to go
  • Set the maximum number of errors to log. $config{'maxEntries'} is so if you forget to delete your log for 10 months, you don't come back and find a 15mb log file
  • If you want each type of error to go to one of your own custom page, this is where you set it. if you don't want to use your own pages, the script will display a basic default error message (which you can also customize)
  • all you need to do is add the error number, and the custom page it displays. works for any valid error number
    $error{'403'}="http://www.yourdomain.com/path/myErrorPage403.html"; or
    $error{'404'}="http://www.yourdomain.com/path/myErrorPage404.html"; etc for as many errors as you need

Open admin.cgi and set the variables

  • Set the Path to perl. (same as above)
  • Set the path to your log file. currently set at "log.txt" but you can be set to anything
  • Set the password for administration
  • Set the username for administration
  • If you keep getting "bad referer" error, set the 'script_name' otherwise leave it as is
  • You can also set your own custom headers and footers for the pages generated

Open .htaccess and set the "ErrorDocument" paths

  • .htaccess (no file name, only 8 letter extension) is a file Apache uses to locally set server variables. You can use it to set the location of the errors it shows (as well as tons of other stuff)
  • What you'll need to do is set the location for each error. The default setting assumes the error cgi is off the domain root at /error/error.cgi
  • The way the script is set up is that error.cgi?500 will return a 500 error, error.cgi?401 will return a 401 etc.

Upload error.cgi, admin.cgi, log.txt, and .htaccess

  • Upload error.cgi, admin.cgi, and log.txt to the location you set your htaccess "ErrorDocument" to
  • Upload htaccess to the root of your site. e.g. the same level as your first index.html -and higher subdirectories will "inherit" from it
  • Upload all the files in ASCII mode (the cgi files MUST be uploaded in ASCII, and for the others it's preferable)
  • CHMOD the cgi files to 755 and the log.txt to 777.
Note
Make sure that the script works before installing the .htaccess file. Just type in the full error.cgi URL, and if you get a the error.cgi's "Unknown Error" message, it's working correctly.