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

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_00010.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

軟體應用 : [分享]AWStats: Apache/IIS的日誌分析工具

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]Awstats 中文安裝手冊
冷日發現前面的介紹對於基本的安裝都說的比較複雜一點!
基本上是比較適合已經玩過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
前一個主題 | 下一個主題 | | | |

討論串




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