AWStats GeoIP 插件

(0 comments)

通过GeoIP插件,在AWStats报表中,可以显示IP地址来自那个国家和地区。

下载Geo::IP和GeoIP C API的源代码,先安装 GeoIP C API

tar zxvf GeoIP.tar.gz
cd GeoIP-1.3.14
./configure
make
make install

接下来安装Geo:IP perl模块,因为需要使用GeoIP的动态链接库文件,修改/etc/ld.so.conf并添加路径:

/usr/local/lib

执行命令ldconfig /etc/ld.so.conf使更改生效,然后安装Geo:IP:

tar zxvf Geo-IP-1.27.tar.gz
cd Geo-IP-1.27
perl Makefile.PL
make
make test
make install

通过Google下载免费的GeoIP Free Country数据库文件。并解压缩到/etc/awstats/GeoIP.dat。

修改AWStats的站点配置文件,添加以下设置:

LoadPlugin="geoip GEOIP_STANDARD /etc/awstats/GeoIP.dat"

这样就可以解析IP地址来自那个国家,使用这个插件会影响8%的性能。

Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required