四虎影视在线影院在线观看,小s货再浪些再咬紧点h,国产精品水嫩水嫩,97精产国品一二三产区
標題:
[求助]
如何更改APACHE日志的格式?
[打印本頁]
作者:
tiantangld
時間:
2012-6-9 12:13
標題:
如何更改APACHE日志的格式?
近日想更改APACHE日志的格式,使其能記錄訪客的User-Agent信息到日志里,但是百度了很多資料,還是沒能學(xué)會
現(xiàn)在的日志記錄下來是這樣:
10.1.1.95 - e800 [18/Mar/2005:12:21:42 +0800] "GET /stats/awstats.pl?config=e800 HTTP/1.1" 200 899
復(fù)制代碼
我想改成這樣:
10.1.1.95 - e800 [18/Mar/2005:12:21:42 +0800] "GET /stats/awstats.pl?config=e800 HTTP/1.1" 200 899 "http://10.1.1.1/pv/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon)"
復(fù)制代碼
哪位大哥知道怎么修改呢?
以下為小弟http.conf的部分信息,不知道是不是改這里?
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "logs/access_log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "logs/access_log" combined
</IfModule>
復(fù)制代碼
作者:
admin
時間:
2012-6-9 15:37
CustomLog "logs/access_log" common
改為
CustomLog "logs/access_log" combined
就可以
作者:
tiantangld
時間:
2012-6-9 18:32
回復(fù)
2#
admin
非常感謝
作者:
tiantangld
時間:
2012-6-9 23:29
回復(fù)
2#
admin
老大,我試著更改重啟了還是不行哦,是不是我改錯哪里了,麻煩老大幫忙在看一下
我更改后,日志還是這樣子的
95.211.139.1 - - [09/Jun/2012:23:16:04 +0800] "GET /store/shoplist-14.html HTTP/1.0" 200 -
復(fù)制代碼
最后附httpd.conf
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "logs/access_log" combined
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
復(fù)制代碼
作者:
admin
時間:
2012-6-10 00:36
這樣是對的
作者:
tiantangld
時間:
2012-6-10 01:38
回復(fù)
5#
admin
終于找到問題所在了,單單修改這里還不行,還要去修改虛擬主機配置文件
作者:
admin
時間:
2012-6-10 10:36
這個是默認的記錄文件,也是所有的
虛擬主機里的是針對站點的
歡迎光臨 WDlinux官方論壇 (http://cd-genova.com/bbs/)
Powered by Discuz! 7.2