加強網站統計 awstats 的主機解析外掛 GeoIP

一般 awstats 的 IP 反解析是會關閉的,所以你看到的主機全是只有 IP address
attachments/200806/0995508899.jpg
但如果要使用它,只要設定 conf 中的 DNSLookup 為 1 就行了
attachments/200806/4209700588.jpg

但是但是,DNSLookup 也是有缺點的

1。如果你的網站流量大,相對的 Log 檔就大,在 awstats 過濾時所花費的時間肯定會很慢,這樣效率可能不太好

2。單單只是 IP 反解析,或許太單調了

接下來介紹的是 GeoIP,它是一個資料庫檔案,這檔案需要事先被下載下來使用

Quote: http://www.maxmind.com/app/ip-locate

What is GeoIP?
GeoIP® is the proprietary technology that drives MaxMind's IP geolocation data and services. GeoIP provides businesses with a non-invasive way to determine geographical and other information about their Internet visitors in real-time. When a person visits your website, GeoIP can determine which country, region, city, postal code, area code the visitor is coming from. Furthermore, GeoIP can provide information such as longitude/latitude, connection speed, ISP, company name, domain name, and whether the IP address is an anonymous proxy or satellite provider.

安裝方式

環境 Fedora 8

yum install GeoIP

清單列表 rpm -ql GeoIP

/etc/GeoIP.conf
/etc/GeoIP.conf.default
/usr/bin/geoiplookup
/usr/bin/geoipupdate
/usr/lib/libGeoIP.so.1
/usr/lib/libGeoIP.so.1.4.4
/usr/lib/libGeoIPUpdate.so.0
/usr/lib/libGeoIPUpdate.so.0.0.0
/usr/share/GeoIP
/usr/share/GeoIP/GeoIP.dat
/usr/share/doc/GeoIP-1.4.4
/usr/share/doc/GeoIP-1.4.4/AUTHORS
/usr/share/doc/GeoIP-1.4.4/COPYING
/usr/share/doc/GeoIP-1.4.4/ChangeLog
/usr/share/doc/GeoIP-1.4.4/INSTALL
/usr/share/doc/GeoIP-1.4.4/LICENSE.txt
/usr/share/doc/GeoIP-1.4.4/README
/usr/share/doc/GeoIP-1.4.4/TODO
/usr/share/doc/GeoIP-1.4.4/fetch-geoipdata-city.pl
/usr/share/doc/GeoIP-1.4.4/fetch-geoipdata.pl
/usr/share/man/man1/geoiplookup.1.gz
/usr/share/man/man1/geoipupdate.1.gz

而 awstats 要的就 是這個檔 /usr/share/GeoIP/GeoIP.dat

編輯 awststs.conf

1。DNSLookup 不需要了,所以設成 0

2。反註解 LoadPlugin,設置正確的路徑

DNSLookup=0
LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"

看到的結果長這樣

attachments/200806/5192644857.jpg

還有還有 GeoLiteCity.dat,用來解析城市、地區的資料庫檔,到這邊下載 http://www.maxmind.com/download/geoip/database/

LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoLiteCity.dat"

這樣 awstats 的 IP 反解析,除了看到的資料較多外,還可降低分析所花費的時間

attachments/200806/1803910667.jpg

http://www.ducea.com/2006/06/14/speedup-awstats-by-using-geoip-instead-of-dns-lookups/
http://www.antezeta.com/awstats/geoip.html
http://diary.tw/jerry/119
標籤: 網站測試
評論: 0 | 引用: 0 | 閱讀: 2872 | 列印 | 文件 | 轉發

發表評論
暱 稱: 密 碼:
網 址: E - mail:
驗證碼: 驗證碼圖片 選 項:
頭 像:
內 容:
  • 粗體
  • 斜體
  • 底線
  • 插入圖片
  • 超連結
  • 電子郵件
  • 插入引用
  • 表情符號