茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1729936 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00065.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2005/9/26 9:53:26
冷日發現前面的介紹對於基本的安裝都說的比較複雜一點!
基本上是比較適合已經玩過awstats的進階使用者的。
所以冷日決定再轉一篇比較基本而簡單的中文安裝手冊。
但是最建議的還是看原文安裝手冊,基本上粉簡單的啦!
原文安裝手冊

Awstats 中文安裝手冊

內容:1. Awstats 安裝手冊 2. 安裝設定 Awstats 3. 建立 Awstats 的 conf 並設定 4. 測試網站專屬的 Awstats 的設定檔 5. 加入 Crontab 排程 6. 測試除錯

1. Awstats 安裝手冊

什麼是 Awstats
AWStats 是一個專門用來分析 Web 站台記錄檔 (log) 的 GPL 授權軟體,目前也已開始支援分析 FTP 站台及郵件伺服器的記錄檔,在 Web 伺服器軟體的部分可以分析 IIS 的 (W3C log format) 記錄檔、Apache 的 (NCSA combined/XLF/ELF log format or common/CLF log format) 記錄檔,以及其他大部分的 web, proxy, wap, streaming 伺服器所產生的紀錄檔。

2. 安裝設定 Awstats

開始安裝 Awstats 並且建立設定檔並更改 Apache 的設定檔案
原始碼2.1: 安裝 Awstats
# emerge awstats
# nano -w /etc/apache2/conf/awstats.conf?#91;入下列資料

#
# Content of this file, with correct values, can be automatically added to
# your Apache server by using the AWStats configure.pl tool.
#

#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/local/awstats/" must reflect your AWStats install path.
#
Alias /awstatsclasses "/usr/share/webapps/awstats/6.1/htdocs/classes/"
Alias /awstatscss "/usr/share/webapps/awstats/6.1/htdocs/css/"
Alias /awstatsicons "/usr/share/webapps/awstats/6.1/htdocs/icon/"
ScriptAlias /awstats/ "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/share/webapps/awstats/6.1/htdocs">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<directory "/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/">
Options +ExecCGI +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</directory>


設定 Apache
編輯 apache2.conf加入下列資料
# nano -w /etc/apache2/conf/apache2.conf
Include conf/awstats.conf


最後重新啟動 apache2 測試我們所新增的設定值是否可以正常啟動
# /etc/init.d/apache2 restart


root@ns awstats # /etc/init.d/apache2 restart
 * Stopping apache2...                           [ ok ]
 * Starting apache2...                           [ ok ]
root@ns awstats #



3. 建立 Awstats 的 conf 並設定

Awstats 必須依照.conf 檔案內容來繪製圖表所以我們要建立專屬的.conf 檔案

原始碼3.1: 建立並設定 Awstats.conf
yourdomain 要替換成你要剛剛在你的網址例如 www.test.com
# cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.yourdomain.com.conf


編輯剛剛複製的設定檔,由於設定檔內容過多這邊指挑幾個重點來說明,這邊就
不多做介紹如有興趣請自行研究說明檔內容
# nano -w /etc/awstats/awstats.yourdomain.com.conf

LogFile="/var/log/apache/access_log"
LogFile="/var/log/apache2/access_log" ?#93;定成你的 Apache Log 存取的路徑

SiteDomain="localhost"
SiteDomain="www.yourdomain.com"

HostAliases="localhost 127.0.0.1 REGEX[myserver.com$]"
HostAliases="www.yourdomain.com"

DirCgi="/cgi-bin/awstats"
DirCgi="/awstats" 更改成之前我們在 awstats.conf 新增的路徑

DirIcons="/awstats/icons"
DirIcons="/awstatsicon" 更改成之前我們在 awstats.conf 新增的路徑

最後存檔離開,就完成了 Awstats 的相關設定了

4. 測試網站專屬的 Awstats 的設定檔

測試剛剛設定的設定檔案是否可以正常執行

原始碼4.1: 測試DNS的 Conf 檔案
# /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/share/webapps/awstats/6.1/
hostroot/cgi-bin/awstats.pl -configdir=/etc/awstats/

Running '"/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/awstats.pl" -update
-config=shop.tecnewsvc.com.tw -configdir="/etc/awstats/"' to update config www.yourdomain.com
Update for config "/etc/awstats/awstats.www.yourdomain.com.conf"
With data in log file "/var/log/apache2/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 1735)
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 1735
 Found 1735 already parsed records.
Parsed lines in file: 307
 Found 0 dropped records,
 Found 4 corrupted records,
 Found 0 old records,
 Found 303 new qualified records.

如果看到以上資訊出現,表示您的 Awstas 可以正確解析 Apache2 所產生的 Log

到這我們已經完成所有的 Awstats 的設定了,恭喜你

5. 加入 Crontab 排程

最後加入排程並且每五分鐘執行一次

原始碼5.1: 加入 Crontab 排程並且每八小時執行一次
# nano -w /etc/crontab
0 */8 * * * /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/share/webapps/
awstats/6.1/hostroot/cgi-bin/awstats.pl -configdir=/etc/awstats/
5 */8 * * * /usr/bin/awstats_updateall.pl now -awstatsprog=/usr/share/webapps/
awstats/6.1/hostroot/cgi-bin/awstats.pl -configdir=/etc/awstats/


這樣就完成了所有的設定 Awstats 頁面的位址就在 http://www.yourdomain.com/awstats/awstats.pl 這邊了

6. 測試除錯

原始碼6.1: 測試除錯
如果看到都是文字沒有任何圖片,還有一堆錯誤訊息的話可能是權限的問題
# chmod 755 /usr/share/webapps/awstats/6.1/htdocs/icon
# chmod 755 /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lang
# chmod 755 /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/lib
# chmod 755 /usr/share/webapps/awstats/6.1/hostroot/cgi-bin/plugins
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   


吃太飽Good JobHiJolinOMGOrz哭XD三八萌水汪汪大眼水草舞失魂打小人
打瞌睡石化交出來印堂黑黑吐吐血(不明液體版)吐血(鮮血版)好心情好夢入睡守門員之魂冷汗直流冷吱吱
完美計畫我不依沒什麼嘛狂暴狂驚幸福御守昏死泡澡空南無南無怒火中燒挖鼻孔
指苦惱煙狂倒地哭哭不害羞扭扭射門烏鴉飛過笑裡藏刀茶高處不勝寒鬼點子崩潰
推眼鏡淒涼淚奔爽被咬了喔呵呵無力感無言無辜畫圈掰掰催眠微笑
感冒想入非非愛之轟炸搞自閉萬年奸臣裝死跪拜禮嘆息槌飛你漫不經心疑惑遠目
鼻青臉腫嘲笑噴暴走撞人樂奔熱蔥不聽蔥妹恭喜樣蔥寶恭喜衝刺運球頭昏目眩濕
臉紅紅舉紅牌舉黃牌翻桌瓊瑤跪哭讚美主勾拳一記偽可愛賊親一個洗澡畢業了
藍藍路壞大叔啦啦隊鞭K書捲心被一臉肅殺怕怕阿飄無盡漩渦窮帥
orz-v2驚-v2不行了驕傲內傷眼睛一亮跌坐-V2熱-V2囧
 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|