=================================================================
M&M Error Director v2.1.2

(c)2003 By Michael May all rights reserved. 
        http://webmasters.winnfreenet.com  (use contact form on page)

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.

 This script can also be used on servers that have built in automated
error pages since the error logging is sometimes very limited.

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

 Can redirect a file not found error back to your index page to prevent
lost customers. Great if you change your site around and have old links
in the search systems.



 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.

 5) Tracks search systems looking for your robots file

 6) Tracks request for your sites icon file

 7) Tracks request for your privacy policy

 8) Tracks worms and spammers request

 9) Can send robots to a seperate file not found page
-------------
Install


 You should have a CGI-BIN directory that is CHMODed to 777 
 Use 766 on some systems ask your admin which to use

1) Edit the path to perl in error.cgi
   #!/usr/local/bin/perl    this is the only thing you should edit in this file.

2) Edit msetup.pl to set your paths.
   Set the following.

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

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

Your Sendmail path. Ask your webmaster.

$mail_program = '/usr/sbin/sendmail';

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

Path to your cgi directory. Ask you webmaster if you do not know

$logpath   =  "/home/public_html/cgi-bin";

Actual server path to the 401 html page. Not the URL Path. We use this path to read
the 401 error page and print it to the screen. See Help about this.
$errorpath =  "/home/public_html/error";

URL directory where your error pages are stored. Do not enter a trailing /

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

The paths to the error files. This is a URL path the $url_Path is added in front of this 
to redirect a user to this page.
 
$error401  = "401.html";
$error403  = "403.html";
$error404  = "404.html";
$error500  = "500.html";
$error001  = "404.html";

 You can now redirect file not found errors to your home index.html page if you like
by using $error404  = "index.html";

 Note that error 001 is displayed to robots. Keep it simple and readable by a robot.



3) Upload error.cgi and msetup.cgi to your CGI directory using text mode! If you do not
   use tet mode upload yuo will get a server error when run.

4) Chmod to 777 on some servers this is 755 ask your admin if you get it
   wrong you will get a server error.

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

6) Test the script by running it.

http://www.yourdomain.com/cgi-bin/error.cgi

If everything is set right you will see a menu to let you test each error. 
If it does not work see Help.


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      (see note)
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            (see note)
ErrorDocument 404 /cgi-bin/error.cgi?404
ErrorDocument 500 /cgi-bin/error.cgi?500


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 file name. You have to trick it, try renaming it localy using your FTP program or
rename it on your server after you upload and then download a local copy.

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

On some systems it will be hidden and you will have to set your ftp client to show\
hidden files. On wsFTP this is called remote file mask and you enter -a in a box.

403 NOTE:  DOS ATACKS and the 403 ERROR
=====================================
The 403 error is a no directory browsing error. But it is also a error shown to IPs that
have been banned from visiting the server.
Since the last release of this program DOS atacks have taken down some servers.
To fight back some servers now auto ban IP'S that are atacking the server.
When a IP is placed in the auto ban list it will be sent a 403 error screen.
To reduce the load on the server the cgi and this script it is best not to redirect 403 errors
but let the server take care of them ASAP.  
I now recomend that you do not use the 403 redirect unless you know what you are doing.


404 NOTE: 
======================================
 On my websites I now redirect all file not found errors back to my index page. 
This pulls in customers that follow broken links.
 A special new error code was inserted to make this work so that robots would
not be redirected but standard File Not found errors would. 





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.
    start at 20 and move it up if yuor server is busy.

 2) You can have more info saved on the user creating the error. What will be
    saved depends on what your server provides. In most cases you do not need this.

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

What kind of email you will get
===============================

    This script will email you a copy of the log and reset when it hits the error counter
    it will then wait till the next day before it mails you again.
    

 
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 really know what you are doing. If you make a mistake and do
             it wrong you will get unlisted so be warned read up on the format
             before creating this file. Robots will not understand your mistakes.

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

W3c          Privacy policy files are new and were not in use on the last update. They
             are stored in a w3c subdirectory and are a automated way for browsers to
             read your privacy policy.
p3p.xml
p3policy.xml


_vti_bin/owssvr.dll  This is a MS office user. The office software is checking your 
                     website to see if you have MS software installed.


sumthin    The slapper worm is probing your system.

formmail    A Spammer is trying to post to your formail scripts so he can send out junkmail
            from your server making it look like you sent it. Do not use formmail if you
            do rename it to something else.

nsiislog.dll Hacker or worm probing for the buffer overrun error in unupdated servers.

default.ida  Hacker or Code red is probing your system.

cmd.exe      sadmind/IIS worm is probing your system.


Sometimes you will also see file request for images that you know are on other servers.
Like advertising images you are hotloading. Some browsers have been known get confused
and try to load a hotloaded image from your server. This is most likely unreported IE bug.


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";

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 the html file into
the cgi-bin directory, in some cases you might have to rename it 401.txt 


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

 This script has been tested and does work. See demo at www.winnfreenet.com/cgi-bin/error.cgi


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

2) Chmod your CGI-BIN to 777 or 755.  Do not trust what your ftp client tells you about the
   chmod status do it again. Servers 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 or 755 sometimes you have to do it again.


 Please visit the website for more up to date info.

http://webmasters.winnfreenet.com


Please help me by placing a link back to
www.winnfreenet.com or webmasters.winnfreenet.com on your error pages. 

Also if you are having problems getting listed in search systems I can help by linking to 
you. Go to www.winnfreenet.com and add your site to our links page.

---
* Have many nice days *







