The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Apache2::LogNotify - Authrization Module

Summary

This module will notify a set of specified users when errors occur. The error and e-mail for notification can be specified on a specific directory or location. If you use CGI::Carp qw(fatalsToBrowser) on perl cgi scripts the Server Error 500 will be trapped by the pperl modules nd the http apache server will display the error on the client browser and the apach status code will be 200.

Configuration

You must add the following directives in order for the module to properly work. Before the Authz phase must be an Access or Authen phase. For most part you want to configure httpd.conf as below.

PerlLoadModule Apache2::LogNotify::Parameters <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all PerlLogHandler Apache2::LogNotify LogError On ErrorType 403 400 500 NotifyMode All ErrorThrottle 1800 Admins joe.smith@somehost.com joey.smith@somehost.com AppOwners james.smith@somehost.com NotifyOptions Email Debug Off </Directory>

Add the directive, "PerlLogHandler Apache2::LogNotify" inside a Directory or Location section to enable Error Notification .

LogErrors: This is use to manualy turn on/off the error notification. On - Turns logging on. Off - Turns logging off

ErrorType: A list of errors to notify about. All other apache error codes will be ignored. Specify which errors to log. This are the http response codes.

NotifyMode: Admin - Send email to Admins only Users - Send email to Users only All - Send email to Admins and Users.

ErrorThrottle: It uses an integer which will represent the number of seconds between multiple e-mails for the same url. If the Directory or Location (URL) gets multiple hits the system will send one e-mail and ignores errors on this url instances that occur within the specified number of seconds on ErrorThrottle. This prevents sending multiple e-mails for the same error on the same url. Each URL will have its own Throttle.

Admins: Specify the Administrator's email. One or more can be used. Defaults to the web site admin.

AppOwners: Specify the application or web page owner(s). One or more can be used. It can be left blank.

NotifyOptions: Use "Email" to send email to Admin and/or AppOwner. This is the only option at this moment.

Debug Debugging messages go to the log file. On - Turn debugging on Off - Turn debugging off

AUTHOR

Carlos B. Rios <carlos.rios@bms.com>