mod_uid : http://www.lexa.ru/programs/mod-uid-eng.html
1.2.3.4 ... 1.2.3.4.1111 用户1
1.2.3.4 ... 1.2.3.4.2222 用户2
1.2.3.4 ... 1.2.3.4.3333 用户3
第2天,即使用户换了IP,
1.2.1.2 ... 1.2.3.4.1111 用户1
1 启用mod_usertrack模块:修改httpd.conf文件
LoadModule usertrack_module libexec/mod_usertrack.so
AddModule mod_usertrack.c
CookieTracking on
CookieDomain .chedong.com
CookieExpires "10 years"
CookieStyle Cookie
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{cookie}n" combined
202.160.180.61 - - [30/Nov/2005:17:38:44 +0800] "GET /phpMan.php/man/HTML::AsSubs/3pm HTTP/1.0" 200 4911 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)" 202.160.180.61.227021133343524377
218.249.22.70 - - [30/Nov/2005:17:38:45 +0800] "GET /referer.js HTTP/1.0" 200 26254 "http://bietile.bokee.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" 218.249.22.70.11531133343525235
202.160.180.61 - - [30/Nov/2005:17:38:48 +0800] "GET /phpMan.php/man/File::CheckTree/3pm HTTP/1.0" 200 4654 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)" 202.160.180.61.222451133343528428
; Column 0 is the first column -- by default this is the "combined" apache log format, but of course you can customize
LogSessIDColumn=10
...
HTTP/1.1 200 OK
Date: Wed, 30 Nov 2005 09:40:16 GMT
Server: Apache/1.3.34 (Unix) mod_gzip/1.3.26.1a PHP/4.4.0
Set-Cookie2: Apache=211.152.33.116.161891133343616145; path=/; max-age=36000; domain=.chedong.com; version=1
Cache-Control: max-age=7200
Expires: Wed, 30 Nov 2005 10:40:16 GMT
X-Powered-By: PHP/4.4.0
Last-Modified: Wed, 30 Nov 2005 09:40:16 GMT
Connection: close
Content-Type: text/html
....
hedong今天忽然跟我说:发现按照我的配置Cookie的值不稳定,我检查了一下:
tail -f chedong_access_log.20051201 |grep 218.249.9.2(这个是我的IP)
然后访问www.chedong.com并浏览,发现日志后面的cookie值果然是变化的……
结果就好多了:
HTTP/1.1 200 OK
Date: Thu, 01 Dec 2005 07:58:35 GMT
Server: Apache/1.3.34 (Unix) mod_gzip/1.3.26.1a PHP/4.4.0
Set-Cookie: chedong=211.152.33.116.216801133423915949; path=/; max-age=315360000; domain=.chedong.com
Cache-Control: max-age=7200
Expires: Thu, 01 Dec 2005 08:58:35 GMT
X-Powered-By: PHP/4.4.0
Last-Modified: Thu, 01 Dec 2005 07:58:35 GMT
Connection: close
Content-Type: text/html