查看完整版本: Awstats 安裝國家和城市插件(GeoIP/GeoIPCityLite)

may5 2010-8-6 22:56

Awstats 安裝國家和城市插件(GeoIP/GeoIPCityLite)

1.分別下載插件程序:
GeoIP:
GeoIP安裝下載:[url]http://www.maxmind.com/download/geoip/api/c/[/url]
# tar -zxvf GeoIP-1.4.5.tar.gz
# cd GeoIP-1.4.5
# ./configure
<如果./configure出現錯誤>
configure: error: no acceptable C compiler found in $PATH
configure failed for srclib/apr
<解決辦法>
yum -y install gcc
<如果./configure出現錯誤>
configure: error: Zlib header (zlib.h) not found. Tor requires zlib to build. You may need to install a zlib development package.
<解決辦法>
yum -y install zlib-devel
# make
<如果make出現錯誤>
make: *** No targets specified and no makefile found.  Stop.
<解決辦法>

請確定您已完成 configure 步驗,或是檢查 configure 步驗是否有任何錯誤訊息。
# make install

2.然後下載Perl庫:[url]http://www.maxmind.com/download/geoip/api/perl/[/url]
GeoIP Perl解包後
# tar -zxvf Geo-IP-1.36.tar.gz
# cd Geo-IP-1.36
# perl MakeFile.PL
# make
# make install

3.再下載GeoIP/GeoIPCityLite兩個信息數據包:
[url]http://www.maxmind.com/download/geoip/database/[/url]
# gzip -d GeoLiteCity.dat.gz
# cp GeoLiteCity.dat /etc/awstats/
[url]http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/[/url]
# gzip -d GeoIP.gz
# cp GeoIP /etc/awstats/

4.#vi /etc/awstats/awstats.你的域名.conf
修改其中的一些配置選項為:
LoadPlugin="decodeutfkeys"  
LoadPlugin="geoip GEOIP_STANDARD /etc/awstats/GeoIP"     
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /etc/awstats/GeoLiteCity.dat"
如果出現無法調用.so文件或者其他共享文件錯誤
編輯/etc/ld.so.conf,在其中加入一行
/usr/local/lib
之後再執行
/sbin/ldconfig /etc/ld.so.conf

5.啟動awstats
手動生成日誌分析文件
#/usr/local/awstats/tools/awstats_updateall.pl now

6.自動生成日誌分析文件,在crond加入
#crontab -e
添加:
*/5 * * * * root /usr/local/awstats/tools/awstats_updateall.pl now
(每5分鐘更新日誌分析文件)

7.通過web查看日誌
http://你的域名/awstats/awstats.pl?config=你的域名
頁: [1]
查看完整版本: Awstats 安裝國家和城市插件(GeoIP/GeoIPCityLite)