永久黄网站色视频免费直播,yy6080三理论日本中文,亚洲无码免费在线观看视频,欧美日韩精品一区二区在线播放
標(biāo)題:
[求助]
如何更改APACHE日志的格式?
[打印本頁]
作者:
tiantangld
時(shí)間:
2012-6-9 12:13
標(biāo)題:
如何更改APACHE日志的格式?
近日想更改APACHE日志的格式,使其能記錄訪客的User-Agent信息到日志里,但是百度了很多資料,還是沒能學(xué)會(huì)
現(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
時(shí)間:
2012-6-9 15:37
CustomLog "logs/access_log" common
改為
CustomLog "logs/access_log" combined
就可以
作者:
tiantangld
時(shí)間:
2012-6-9 18:32
回復(fù)
2#
admin
非常感謝
作者:
tiantangld
時(shí)間:
2012-6-9 23:29
回復(fù)
2#
admin
老大,我試著更改重啟了還是不行哦,是不是我改錯(cuò)哪里了,麻煩老大幫忙在看一下
我更改后,日志還是這樣子的
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
時(shí)間:
2012-6-10 00:36
這樣是對的
作者:
tiantangld
時(shí)間:
2012-6-10 01:38
回復(fù)
5#
admin
終于找到問題所在了,單單修改這里還不行,還要去修改虛擬主機(jī)配置文件
作者:
admin
時(shí)間:
2012-6-10 10:36
這個(gè)是默認(rèn)的記錄文件,也是所有的
虛擬主機(jī)里的是針對站點(diǎn)的
歡迎光臨 WDlinux官方論壇 (http://www.fsowen.com/bbs/)
Powered by Discuz! 7.2