Chinaunix首页 | 论坛 | 博客
  • 博客访问: 175770
  • 博文数量: 159
  • 博客积分: 7007
  • 博客等级: 准将
  • 技术积分: 1750
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-17 15:05
文章分类

全部博文(159)

文章存档

2010年(39)

2009年(106)

2008年(14)

我的朋友

分类: LINUX

2009-07-07 15:41:49

安装GeoIP

Geo-IP C-API ()下载C库:
Geo-IP Perl-API ()下载Perl库:
Geo::IPfree ()

[root@tomcat ~]# tar zxvf GeoIP-1.4.6.tar.gz 

[root@tomcat GeoIP-1.4.6]# ./configure 

[root@tomcat GeoIP-1.4.6]# make

[root@tomcat GeoIP-1.4.6]# make install

[root@tomcat GeoIP-1.4.6]# cd ..

[root@tomcat ~]# tar zxvf Geo-IP-1.38.tar.gz 

[root@tomcat Geo-IP-1.38]# perl Makefile.PL 

[root@tomcat Geo-IP-1.38]# make

[root@tomcat Geo-IP-1.38]# make install

[root@tomcat Geo-IP-1.38]# cd ..

[root@tomcat ~]# tar zxvf Geo-IPfree-0.6.tar.gz 

[root@tomcat ~]# cd Geo-IPfree-0.6

[root@tomcat Geo-IPfree-0.6]# perl Makefile.PL 

[root@tomcat Geo-IPfree-0.6]# make

[root@tomcat Geo-IPfree-0.6]# make install

[root@webserver Geo-IPfree-0.6]# cd ..

[root@webserver src]# wget

[root@webserver src]# wget
解压缩上面的文件后放至/usr/local/share/GeoIp/
[root@tomcat ~]# vi /etc/awstats/awstats.
LoadPlugin=”decodeutfkeys”
LoadPlugin=”hashfiles”
LoadPlugin=”geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat”
LoadPlugin=”geoip_city_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoLiteCity.dat”

安装XWhois
# perl -MCPAN -e shell
cpan> install Net::XWhois
修改/usr/local/etc/awstats/awstats.,取消下面这行的注释,启用此插件
LoadPlugin=”hostinfo”

安装decodeutfkeys,解决搜索搜索关键词乱码问题(不管是utf8,gb2312…)
# perl -MCPAN -e shell
cpan> install URI::Escape
修改/usr/local/etc/awstats/awstats.,取消下面这行的注释,启用此插件
LoadPlugin=”decodeutfkeys”

更新日志
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=blog.zhangjianfeng.com -update -lang=cn

++仅统计分析指定URL
OnlyFiles=”REGEX[/abc/abc]” #URL中包括/abc/abc/,如/abc/abc/xxxx

++Update statistics when I use a load balancing system that splits my logs?
LogFile=”/pathto/logresolvemerge.pl file*.log |” #在配置文件中指定
logresolvemerge.pl file1.log file2.log … filen.log > newfiletoprocess.log #先用工具把所有LOG合并,再配置LogFile

++多台缓存服务器的日志合并处理
多服务器的日志合并统计 http://blog.zhangjianfeng.com/article/522

++如果调用月度速度很慢的时候,可以考虑把输出文件静态化
$path/awstats/tools/awstats_buildstaticpages.pl -update -config=blog.zhangjianfeng.com -lang=cn -dir=$path/data/www/mgr1/test/awstats/blog.zhangjianfeng.com/ -awstatsprog=$path/app/tools/awstats/wwwroot/cgi-bin/awstats.pl -DatabaseBreak=month
#-month=mm 使用月份的两位数
#-builddate=%04%02%01% 以某一日期为文件名输出页面

++提高些处理速度(unique url reach flush limit of 5000)
在awstats.pl中修改. 默认值是5000,如果内存较大,可以适当加大,比如50000

阅读(534) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~