Apache Send Email On 500 Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of apache 500 error troubleshooting this site About Us Learn more about Stack Overflow the company Business apache 500 error no log Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask apache internal server error 500 Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign http 500 error apache up How can I configure apache to send an email on every HTTP error 500 up vote 3 down vote favorite 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? http
Apache Php 500 Error
apache httpd.conf share|improve this question asked Aug 31 '12 at 6:32 Jarl 2,17821425 add a comment| 3 Answers 3 active oldest votes up vote 8 down vote accepted 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 http://serverfault.com/questions/45246/linux-monitor-logs-and-email-alerts Write an apache module. I think that mod_tee is a good starting point. share|improve this answer answered Sep 3 '12 at 10:33 Jarl 2,17821425 add a comment| up vote 6 down vote One way you can do this is use a php script that sends email, as well as output some sort of 500 message. Then use the ErrorDocument direc
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Apache 500 Error Page
this site About Us Learn more about Stack Overflow the company Business Learn apache 404 error more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ apache 400 error Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody http://stackoverflow.com/questions/12210011/how-can-i-configure-apache-to-send-an-email-on-every-http-error-500 can answer The best answers are voted up and rise to the top How can I configure apache to send an email on every HTTP error 500 up vote 2 down vote favorite 1 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://serverfault.com/questions/423157/how-can-i-configure-apache-to-send-an-email-on-every-http-error-500 HTTP error 500 Internal server error. How can I do that? apache-2.2 http httpd.conf share|improve this question edited Aug 31 '12 at 6:27 asked Aug 31 '12 at 5:43 Jarl 18818 Are you running Linux? –quanta Aug 31 '12 at 5:57 Yes. I would expect that that did not affect the answer. –Jarl Aug 31 '12 at 6:02 possible duplicate of Linux monitor logs and email alerts? –quanta Aug 31 '12 at 6:06 Why do you tag this with linux? The question is not linux specific –Jarl Aug 31 '12 at 6:16 @quanta: Thanks for pointing me to Linux specific workarounds if no one can answer this question. However I do not consider the question a duplicate. –Jarl Aug 31 '12 at 6:26 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote You can create a custom 500 file. Assuming you are using Apache you would add the following line to your .htaccess ErrorDocument 500 /errorfilename.php This code basically tells the server that if a user encounters a 500(internal server error) Error to display errorf
Annotate this POD CPAN RT New 1 Open 0 View/Report Bugs Module Version: 1.026 Source NAME SYNOPSIS DESCRIPTION MOTIVATION TESTING http://search.cpan.org/~djr/Apache-ErrorControl-1.026/ErrorControl.pm ERROR EMAILS EXAMPLE EMAIL OPTIONS HTTPD CONFIG TEMPLATE TMPL_SET TMPL_VAR / TMPL_IF OPTIMISATION CAVEATS BUGS SEE ALSO AUTHOR LICENSE NAME Apache::ErrorControl - Apache Handler for Templating Apache Error Documents SYNOPSIS in your httpd.conf PerlModule Apache::ErrorControl
Error 404: File Not Found
The file you were looking for is not here, we must have deleted it - or you apache 500 error just might be mentally retarded
Error 500: Internal Server Error
We are currently experiencing problems with our server, please call back later
Time of Error:
Requested From:
Requested URL:
Website Base URL:
Contact Email: support@mouse.com
DESCRIPTION This mod_perl content handler will make templating your ErrorDocument pages easy. Basically you add a couple of entries to your httpd.conf file restart apache, make your template and your cruising. The module uses HTML::Template::Set (which is essentially HTML::Template with the ability to use TMPL_SET tags). So for help templating your error pages please see: HTML::Template::Set and HTML::Template. Also check the OPTIONS section of this documentation for available TMPL_SET/TMPL_IF and TMPL_VAR params. By default when an error 500 (internal server error) is encountered an error email is sent about it. the addresses emailed depend on the options specified. please see