了解Apache的访问日志 [英] Understanding Apache's access log

查看:125
本文介绍了了解Apache的访问日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的访问日志中此行中的每件事是什么意思?

What do each of the things in this line from my access log mean?


127.0.0.1--[05 / Feb / 2012:17:11:55 +0000] GET / HTTP / 1.1 200 140- Mozilla / 5.0(Windows NT 6.1; WOW64)AppleWebKit / 535.19(KHTML,like Gecko)Chrome / 18.0.1025.5 Safari / 535.19

127.0.0.1 - - [05/Feb/2012:17:11:55 +0000] "GET / HTTP/1.1" 200 140 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.5 Safari/535.19"


推荐答案

您似乎正在使用组合日志格式


LogFormat%h%l%u%t \%r\%> s%b \%{Referer} i\ \%{User-agent} i\

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined




  • %h是远程主机(即客户端IP)

  • %l是由身份确定的用户身份(通常不使用,因为不可靠)

  • %u是由HTTP身份验证确定的用户名

  • %t是收到请求的时间。

  • %r是来自客户端的请求行。 ( GET / HTTP / 1.0)

  • %> s是从服务器发送到客户端的状态码(200、404等)

  • %b是对客户端的响应大小(以字节为单位)

  • 引用者是参考请求标头(包含该请求发起页面的URL)(如果有),以及- 否则。

  • 用户代理是浏览器标识字符串。

    • %h is the remote host (ie the client IP)
    • %l is the identity of the user determined by identd (not usually used since not reliable)
    • %u is the user name determined by HTTP authentication
    • %t is the time the request was received.
    • %r is the request line from the client. ("GET / HTTP/1.0")
    • %>s is the status code sent from the server to the client (200, 404 etc.)
    • %b is the size of the response to the client (in bytes)
    • Referer is the Referer header of the HTTP request (containing the URL of the page from which this request was initiated) if any is present, and "-" otherwise.
    • User-agent is the browser identification string.
    • 格式化程序的完整列表(?)可在此处找到。文档的同一部分还列出了其他常见的日志格式;日志看起来不太像这样的读者可能会发现那里列出了他们的Apache配置所使用的模式。

      The complete(?) list of formatters can be found here. The same section of the documentation also lists other common log formats; readers whose logs don't look quite like this one may find the pattern their Apache configuration is using listed there.

      这篇关于了解Apache的访问日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆