全面列出 HTTP 请求(IP、URL 等)

全面列出 HTTP 请求(IP、URL 等)

有没有办法显示 apache/httpd 进程列表及其 pid 和有关请求的一些信息?例如请求 URL、任何参数、域、内部/外部 IP 地址等。

我尝试过诸如netstat或之类的方法htop,但它们并没有告诉我太多有关正在发生的事情的信息。

我希望这样,这样我就可以选择一个进程来终止,而不必重新启动服务,从而终止所有进程。

答案1

ExtendedStatus On然后httpd.conf运行:

service httpd fullstatus

您应该会获得所需的信息,例如:

Server Version: Apache/2.3.8 (Unix) mod_ssl/2.3.8 OpenSSL/1.0.0a
Server Built: Aug 24 2010 23:25:11
Current Time: Thursday, 16-Sep-2010 19:20:09 UTC
Restart Time: Thursday, 16-Sep-2010 00:00:00 UTC
Parent Server Generation: 0
Server uptime: 19 hours 20 minutes 9 seconds
Total accesses: 8417703 - Total Traffic: 479.2 GB
CPU Usage: u114.008 s94.3594 cu0 cs0 - .299% CPU load
121 requests/sec - 7.0 MB/second - 59.7 kB/request
198 requests currently being processed, 186 idle workers
W_CC_KKK___KC__K_KKKK_KCK_K___K_KKK__K_K_K__C_KK_CKW_K_K_K____CK
KK_K___KKK_KKCK__K___K_K___KCK__K_KKKC__C__KKCCK_KCWK_KKCK_KKKKC
KC__K_KKK____KKKW____C_K_____C_K_KK________KK___C...............
................................................................
................................................................
................................................................
................................................................
................................................................

Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process


    Srv PID Acc M   CPU SS  Req Conn    Child   Slot    Client  VHost   Request
    0-0 77149   0/155/14434 W 19.

63  1   0   0.0 1.06    726.43 205.231.104.48   activemq.apache.org GET /schema/core/activemq-core-5.1.0.xsd HTTP/1.1
0-0 77149   0/106/14490 _ 19.52 0   0   0.0 0.85    926.97 91.89.133.31 www.apache.org  NULL

相关内容