Code: Select all
#!/usr/bin/perl
use LWP::Simple;
$getHeader = get('http://www.example.com/header.php');
print "Content-type: text/html\n\n";
print $getHeader;
exit;
Code: Select all
[Fri Nov 08 21:17:09.931673 2019] [cgi:warn] [pid 1983] [client 123.45.67.89:47530] AH01220: Timeout waiting for output from CGI script /home/example/public_html/cgi-bin/script.cgi, referer: http://www.example.com
[Fri Nov 08 21:17:09.932056 2019] [cgi:error] [pid 1983] [client 123.45.67.89:47530] Script timed out before returning headers: script.cgi, referer: http://www.example.com
I tried LWP::UserAgent, but it didn't work, either.
After much poking and prodding, I finally discovered that if I disable CSF then the scripts work! So the problem appears to be a security issue, something (somewhere) is blocking something (somewhere) that's required by LWP.
I didn't have any IPs in the Temporary Deny, and only 2 in the Permanent Deny. So I commented those two out and re-enabled CSF... the scripts worked fine! So one of those IPs, right?
I wanted to whitelist the IP so this doesn't happen again, so I tried to trace it down. I uncommented one of them, restarted it, and the scripts still worked. So it has to be the other one.
For the sake of testing, I uncommented it, too, then restarted. And... the scripts still worked.
So now I'm at a loss. I didn't actually change anything, but restarting CSF seemed to clear the issue. But if that's the case, how do I make sure this problem doesn't happen again?