Apache – How to Monitor Current Requests

apache-2.2PHPweb-server

On a number of occasions, I've run across apache servers that get "clogged" serving requests for a poorly-written PHP page. Looking at the HTTP status page, all the servers are in the "W" state. And while sometimes it's possible to find the offending site using the logs and a bit of lucky guessing, on systems running a large number of websites, it's very nearly impossible to find the offending script using the logs.

So, is there a way to find out what request a given apache process is serving "right now"? I've looked in the /proc/ directory and not found anything useful. I would imagine strace could prove helpful, but only if you got to it BEFORE the request started.

Any ideas?

By the way: I'm familiar with the "slowloris" DOS attack, and it's not what I'm talking about.

Best Answer

Turn on the ExtendedStatus flag in httpd.conf.

Your server status page will then list the VHost and URI of each file being served.

Related Topic