httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MadTh <madan.feedb...@gmail.com>
Subject Re: [users@httpd] monitoring HTTP Error Codes
Date Sun, 18 Oct 2009 21:24:31 GMT
Thank you Scott, I knew about .htacess but was not sure that it is supported
over "server config" context in apache.






On Mon, Oct 19, 2009 at 2:46 AM, Scott Haneda <talklists@newgeo.com> wrote:

> Set your Error Document directive:
> http://httpd.apache.org/docs/2.0/mod/core.html#errordocument
>
> ErrorDocument 404 /place/mailer.php
> ErrorDocument 406 /place/mailer.php
> ErrorDocument 500 /place/mailer.php
> ErrorDocument 501 /place/mailer.php
>
> In mailer.php, or whatever scripting language you chose to use, you will
> have code that sends an email.  I would be careful, this can get a little
> out of hand, and you will get a lot of emails.
>
> I may be inclined to do something like this: (pseudo code)
>
> no_mail_arr = array('google', 'bing', etc etc etc)
> if (user_agent not in array)
>        $message = the headers + the page name + the url + the agent +
> referrer
>        mail(someone@example.com 'error on page $page', $message)
> end if
>
> In reality, I think it would be better to just set up a custom logging
> directive, and log any http you desire, to a special log, with all the data
> you need. Run that log through any good stats software, and you will be much
> better off.
>
> --
> Scott * If you contact me off list replace talklists@ with scott@ *
>
>
> On Oct 18, 2009, at 1:28 PM, MadTh wrote:
>
>  Please advise on how can we monitor HTTP Error Codes on a web server and
>> then send an email alert upon errors.
>>
>> The HTTP Error Codes we need alerts on are 404,406,500 and 501 errors
>>
>> We do not want to monitor it for a particular site, but serverwide.  So we
>> need to find some way to pull the details from apache error log (
>> /etc/httpd/logs/error_log
>>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Mime
View raw message