關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 安裝 AWStats 流量統計

    Posted on April 29th, 2006 Sam Tang 1 comment

    AWStats 是一套功能強大的流量統計工具,分析的項目十分清楚詳細,而它是透過讀取 Apache 所產生的紀錄檔造出統計數據,所以不需要在網站加上特定的 javascript 或 html。以下是安裝及配置 AWStats 的步驟: (我的安裝環境是 Red Hat Enterprise Linux 4)

    1. 下載 AWStats,目前最新的穩定版是 6.5。

    2. 執行以下指令安裝:

    tar zxvf awstats-6.5.tar.gz
    mv awstats-6.5 /usr/local/awstats
    chown -R apache.apache /usr/local/awstats
    chmod +x /usr/local/awstats/wwwroot/cgi-bin/*
    chmod +x /usr/local/awstats/tools/*
    mkdir /etc/awstats
    mkdir /var/lib/awstats

    3. AWStats 已經安裝完成,接著就要執行 AWStats 內建的設定程式進行設定:

    cd /usr/local/awstats/tools/
    ./awstats_configure.pl

    首先程式會問你建立報表的主機名稱,輸入網站 hostname 即可,然後便是儲存設定檔的目錄,輸入 /etc/awstats,然後只要做幾下確認及重新啟動 Apache 就完成了。

    假如你的 hostname 是 mydomain.com,那便打開 /etc/awstats/awstats.www.mydomain.com.conf,裡面有一行是:

    LogFile="/var/log/httpd/mylog.log"

    將上面那行的 /var/log/httpd/mylog.log 改成你用 Apache 產生的紀錄檔。

    4. 安裝及設定都完成了,現在要讓 AWStats 讀取 Apache 紀錄檔的數據了,執行以下指令:

    /usr/local/awstats/tools/awstats_updateall.pl now

    你可以將以下指令放到 crontab 裡面,讓系統自動執行更新程序。而 AWStats 的報表位置是 http://網域名稱/awstats/awstats.pl


     

    One response to “安裝 AWStats 流量統計”

    1. 还是装不好啊!我用DH的空间,是不是安装方法有所不同

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word