天天看點

AWStats使用

AWStats是使用perl語言編寫的web log分析工具。

1.安裝

從官網下載下傳tar檔案,解壓至/usr/local/awstats/

2.初始化配置

切換目錄至/usr/local/awstats/tools下,執行以下指令:

perl awstats_configure.pl

這個配置腳本執行的過程中,需要使用者回答一些設定問題。

awstats_configure.pl會修改httpd.conf,将"CustomLog /yourlogpath/yourlogfile common"改為“CustomLog /yourlogpath/yourlogfile combined",log的format改變了。同時将”/usr/local/awstats/wwwroot"設定為可通路的apache頁面。

3.更新資料

在/usr/local/awstats/wwwroot/cgi-bin/目錄下,執行以下指令:

perl awstats.pl -config=yoursitename -update

将讀取log檔案,運作分析處理程式,并将分析結果存儲在/var/lib/awstats/下。

注:yoursitename是第二步設定的sitename,

注:首次運作時,可能會提示錯誤“不存在/var/lib/awstats”目錄,手動建立這個目錄就好了。

4.生成報告

同上,在/usr/local/awstats/wwwroot/cgi-bin/目錄下,執行以下指令:

perl awstats.pl -config=mysite -output -staticlinks > awstats.yoursitename.html

awstats在統計UV時使用的時通路主機的ip位址。

參考:http://www.awstats.org/使用說明。