Apache2:如何在服务器端跟踪客户端下载进度

Apache2:如何在服务器端跟踪客户端下载进度

我在 Ubuntu Server 上运行 Apache2。客户端使用浏览器从该服务器下载一个大文件(约 2GB)。

我如何在服务器端跟踪下载进度。我想查看客户端的特定下载进度。

谢谢!

答案1

我认为当 Apache 提供静态文件时这是不可能的。

但是,您可以使用脚本来传递相应的标头并将文件写入客户端。这样,您就可以将当前进度写入日志文件。

答案2

你试过了吗mod_status来自阿帕奇?

每个 worker 的状态、该 worker 已执行的请求数以及该 worker 服务的总字节数 (*)

你能得出你想要的结果吗?

它看起来像这样:

Srv     PID     Acc         M   CPU     SS Req  Conn Child  Slot    Client  VHost           Request
0-22    30807   0/328/6417  _   111.81  2   0   0.0  2.84   37.39   1.2.4.2     
0-22    30807   0/266/5823  _   111.81  2   0   0.0  1.32   32.97   1.2.4.2 conn.local:80   GET /path/to/file HTTP/1.0

Srv     Child Server number - generation
PID     OS process ID
Acc     Number of accesses this connection / this child / this slot
M       Mode of operation
CPU     CPU usage, number of seconds
SS      Seconds since beginning of most recent request
Req     Milliseconds required to process most recent request
Conn    Kilobytes transferred this connection
Child   Megabytes transferred this child
Slot    Total megabytes transferred this slot

相关内容