Wdcp如何让服务器显示User-Agent、Referer等信息

WDCP如何让服务器显示User-Agent、Referer等信息比如我们要显示百度蜘蛛或google

WDCP的默认日志显示,是不显示User-Agent、Referer等信息的

那么如何修改呢

打开我们的apache的配置文件,配置文件在这里

/www/wdlinux/apache/conf/httpd.conf

找到类似代码

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

将combined和common换一下位置即可

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


最后重启服务器试一下吧!

157.55.39.125 - - [24/May/2016:06:08:20 +0800] "GET /archives/date/2014/11 HTTP/1.1" 200 11113 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
203.208.60.190 - - [24/May/2016:06:09:02 +0800] "GET /archives/2016_04_798.html/9-2 HTTP/1.1" 200 6002 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
203.208.60.181 - - [24/May/2016:06:09:48 +0800] "GET /page/4?21 HTTP/1.1" 200 12258 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"




爆款云服务器s6 2核4G 低至0.46/天,具体规则查看活动详情Blog Img