I have some server applications running on apache2; Ruby on Rails, PHP and others.
In all cases I would like apache to send me an email whenever apache responds a HTTP error 500 Internal server error.
How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is not possible to configure apache to send emails.
There are some things you can do to achieve the same result:
You can use the ErrorDocument directive to let it point to some CGI
script, that be a perl, PHP, or any other server-side executed
script. The script can then send an email and respond a Error 500
document.
You can use some external tool to watch your apache log
files and configure theese tools to send you emails. There are several tools and ways to do this. For Linux many
tools and methods are suggested on
https://serverfault.com/questions/45246/linux-monitor-logs-and-email-alerts
Write an apache module. I think that mod_tee is a good starting point.