=================================================================
M&M Error Director v1.3

(c)2001 By Michael May all rights reserved. 
        http://webmasters.winnfreenet.com  tmaster@bigfoot.com

This software is Shareware or FreeViewWare (tm).
You are free to use as long as you use the provided error pages
with my banners and links to the download site.  You may register
this software for a donation of $5 and remove the banners but I
request you keep the link to my site. You may register this
software for a donation of $15 and remove all links to my site.
Please check website for ordering info.


=================================================================


 Error director lets you create custom error pages like the pros.

 Will not triger your webservers SPAM detectors and get your
 account locked down.


 1) Redirects users to a html error page that you can edit.

 2) Logs all errors to a text file.

 3) Mails you a copy of the log file every time a preset limit
    is reached. But never more than once a day.

 4) Custom hacker error page you can redirect private files to.



-------------
Install


 You should have a CGI-BIN directory that is CHMODed to 777


1) Edit error.cgi with a text editor to set your paths.
   Set the following.

Your path to perl. This one works on all the sites I have found.

#!/usr/local/bin/perl

# Email to send a report to
$email = 'me@mydomain.com';

# Email report will be sent from
$fmail = 'mywebsite@mydomain.com';


# Enter a name for this website
$identify = "My Website Name";

 Path to your cgi directory. Here are some samples.
 If you don't know it you must ask your webmaster

 hypermart = /data1/hypermart.net/USERNAME/cgi-bin
 virtualave= /data1/virtualave.net/USERNAME/public_html/cgi-bin
 portland  = /home/USERNAME/cgi-bin


$logpath   =  "/yourpath-to-your-directory/cgi-bin";

 This is used to read in the 401 error page only. 

$errorpath =  "/yourpath-to-your-directory/error";

 URL directory where your error pages are stored. This can be in the root
 or a subdirectory. Do not enter a trailing /

$url_path  = "http://www.mydomain.com/error";


 Your Sendmail path. This is optional because the script will search a known
list of paths and use the one that works. If you do know your path enter
in on the first $mailer line. 

 Portland users must enter a special path on the first line like this
 '/usr/lib/sendmail -u yourusername'  your username goes after the -u 


2) Upload error.cgi to your CGI directory using text mode!

3) Chmod to 777

4) Upload your error pages to the location you set in the script.

5) Test the script by entering the path.

 www.yourdomain.com/cgi-bin/error.cgi?404

This should display the 404.html page if it does not then start over you 
must have mistyped a path or not chmoded the script right.
 If it still does not work goto setup Help.


If the above works try all of the following errors.

 www.yourdomain.com/cgi-bin/error.cgi?401
 www.yourdomain.com/cgi-bin/error.cgi?403
 www.yourdomain.com/cgi-bin/error.cgi?404
 www.yourdomain.com/cgi-bin/error.cgi?500
 www.yourdomain.com/cgi-bin/error.cgi


With everything working you can install the .htaccess file.  This
file tells the server where to send a error. Your file should hold the
following. 

Options -Indexes 
ErrorDocument 401 http://www.mydomain.com/cgi-bin/error.cgi?401
ErrorDocument 403 http://www.mydomain.com/cgi-bin/error.cgi?403
ErrorDocument 404 http://www.mydomain.com/cgi-bin/error.cgi?404
ErrorDocument 500 http://www.mydomain.com/cgi-bin/error.cgi?500

Some servers do not allow a domain name and require only your path.

Options -Indexes 
ErrorDocument 401 /cgi-bin/error.cgi?401
ErrorDocument 403 /cgi-bin/error.cgi?403
ErrorDocument 404 /cgi-bin/error.cgi?404
ErrorDocument 500 /cgi-bin/error.cgi?500


If you wish to create special hack screens for your private files you
may add lines to this file like this.

Redirect /cgi-bin/mypasswords.txt http://my.domain.com/cgi-bin/error.cgi?


A sample file has been provided named htaccess.txt you will need to rename this
file to .htaccess using the rename option on your FTP program. After you upload it.

It is hard to rename this file localy under windows because windows thinks it is an
invalid name. You have to trick it, try renaming it localy using your FTP program.


The .htaccess file should be located in your root directory.





Settings
===========

 The script has the following options.


 1) No of errors to save before sending a email. 
    It depends on how often you want a error report and how busy your server is.
    100 or 200 should work ok.

 2) You can have more info saved on the user creating the error. What will be
    saved depends on what your server provides but you most likely will get his
    domain name and any cookies you saved on his browser. This sometimes will
    allow you to tell just who created the error.

 3) The email notice can be turned off and the log text log will just reset ever
    set# of errors. 

 
What you will see in the log
============================

robots.txt   If you do not see robot request several times a month then your site is no
             longer listed in the search systems. If you do not want to see the robots
             report add 
             Redirect /robots.txt http://www.mydomain.com/errordir/404.html
             to your .htaccess file. Do not create a robots.txt file unless
             you have a directory you do not want searched. If you do it wrong
             you will get unlisted so be warned read up on the format before creating
             this file. You are not allowed to make mistakes.

favicon.ico  A user bookmarked your account but you do not have a icon file that
             his browser (ie5) could store with your bookmark. Suggest you go to
             www.favicon.com and read up on the icon files. Everyone should have one.


Failed Password redirect problems
=================================

It has been found that password failures can not be redirected to a HTML file. Because of
this the script now reads in your 401.html file and prints it to the users screen.
A new path has been added that you must set.

$errorpath =  "/yourpath-to-your-directory/error";

Because of this the 401.html file will be displayed from the directory of the password
falure. You must make sure that any photos in this html file have the full path name or
they will not load in the users browser. The sample files are writen to run from a \error
directory.

If you find that the script works but does not display the 401 error page check to be sure
you got the path right. If it still doesn't work you may have to move that html file into
the cgi-bin directory. 


    
Setup Help
==========

 This script has been tested on Hypermart Virtualave and Portland and does work.


1) Recheck the path settings in the script. Make sure you do know your correct path.

2) Chmod your CGI-BIN to 777.  Do not trust what your ftp client tells you about the
   chmod status do it again. Portland has been known to report a false status to your
   ftp client.

3) Reupload the script making sure you do it in text mode. You may have to turn off
   auto and force your FTP client into text mode.

4) Chmod the script 777 it does not matter that you did it before do it again.


If you are not on any of the tested servers and all of the above does not start
the script to working then please visit the website for more up to date info.

http://webmasters.winnfreenet.com

tmaster@bigfoot.com
---
* Have many nice days *







