Pipe apache 2.4 ErrorLog to script
Hi
Title pretty much says it all, I'm testing a new way of pinning down redirection loops by piping errors through a script which recognizes the relevant error and simultaneously captures the Apache request status. This would show the faulty script without bogging down the entire server by putting Apache into debug logging mode.
I've managed to get a script written and it does execute when Apache starts but only for the first two errors then nothing.
I've added this line to the pre-virtual host include (the script includes writing to the error_log):
And here is the script:
Help!
ErrorLog "|$/usr/local/apache/ApacheState.pl"
And here is the script:
#!/usr/bin/perl
$|=1; # Don't buffer
use strict;
use warnings;
use LWP::Simple;
open (MYFILE, '>>/usr/local/apache/logs/error_log');
print MYFILE get('http://127.0.0.1/whm-server-status');
my $input = ;
chomp($input);
print MYFILE $input;
close (MYFILE);
exit;
Help!
-
Hello :) The following third-party URL may help guide you: Piping Apache log through script - not working for error log However, you may also want to seek out the assistance from a qualified system administrator for assistance with developing your custom script if you do not receive sufficient user-feedback: System Administration Services Thank you. 0
Please sign in to leave a comment.
Comments
1 comment