我是武男, 24歲, 大家都叫我阿男...有的人還會叫我白目研究生...

Awstats Install Steps

Autor 白目研究生

說明:

AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.
Take a look at this comparison table for an idea on features and differences between most famous statistics tools (AWStats, Analog, Webalizer,…).
AWStats is a free software distributed under the GNU General Public License. You can have a look at this license chart to know what you can/can’t do.
As AWStats works from the command line but also as a CGI, it can work with major web hosting provider which allow Perl, CGI and log access.

官網:http://awstats.sourceforge.net/

語言:英文/繁體中文

版本:Last stable version is 6.7 - 2007-07-07 04:05

下載:按這裡下載

測試安裝環境:FreeBSD 6.2 Release

Install Steps:

安裝目錄

cd /usr/ports/www/awstats; make install clean

安裝完成會出現下面字樣,提示修改http.conf

*****************************************************************
Please add the following to your apache config, and restart.

#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses “/usr/local/www/awstats/classes/”
Alias /awstatscss “/usr/local/www/awstats/css/”
Alias /awstatsicons “/usr/local/www/awstats/icons/”
ScriptAlias /awstats/ “/usr/local/www/awstats/cgi-bin/”

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/usr/local/www/awstats/”>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

*****************************************************************

If you are upgrading from AWStats 6.4 or older, please note the following:

If you used the geoip plugin, you must edit your AWStats config file
to change the line
LoadPlugin=”geoip GEOIP_STANDARD”
into
LoadPlugin=”geoip GEOIP_STANDARD /pathto/GeoIP.dat”

***************************************************

修改http.conf

ee /usr/local/etc/apache2/httpd.conf;

將下面內容加上去

Alias /awstatsclasses “/usr/local/www/awstats/classes/”
Alias /awstatscss “/usr/local/www/awstats/css/”
Alias /awstatsicons “/usr/local/www/awstats/icons/”
ScriptAlias /awstats/ “/usr/local/www/awstats/cgi-bin/”

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/usr/local/www/awstats/”>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

開始設定awstats

cd /usr/local/www/awstats; ./awstats_configure.pl

開始下面提示安裝訊息設定

—– AWStats awstats_configure 1.0 (build 1.6) (c) Laurent Destailleur —–
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to ‘understand’ all possible ways to use AWStats…
Read the AWStats documentation (docs/index.html).

—–> Running OS detected: Linux, BSD or Unix
Warning: AWStats standard directory on Linux OS is ‘/usr/local/awstats’.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/usr/local/www/awstats
to standard directory:
/usr/local/awstats
And then, run configure.pl from this location.
Do you want to continue setup from this NON standard directory [yN] ? 這裡按Y

—–> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path (’none’ to skip web server setup):
> 這裡輸入機器Apache的http.conf設定檔位置,程式會自動檢查該路徑有沒有該檔案

—–> Check and complete web server config file ‘/usr/local/etc/apache2/httpd.conf’
Add ‘Alias /awstatsclasses “/usr/local/www/awstats/wwwroot/classes/”‘
Add ‘Alias /awstatscss “/usr/local/www/awstats/wwwroot/css/”‘
Add ‘Alias /awstatsicons “/usr/local/www/awstats/wwwroot/icon/”‘
Add ‘ScriptAlias /awstats/ “/usr/local/www/awstats/wwwroot/cgi-bin/”‘
Add ‘<Directory>’ directive
AWStats directives added to Apache config file.

—–> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? 是否加入上面參數設定,這裡按Y

—–> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> 輸入設定檔名稱名稱前置字元

—–> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
> 這裡按照預設的路徑輸入,什麼出現下面錯誤訊息。

—–> Create config file ‘/usr/local/www/awstats/cgi-bin/awstats.210.71.11.167.conf’
Error: Failed to open ‘/usr/local/www/awstats/wwwroot/cgi-bin/awstats.model.conf’ for read.

那是因為該路徑找不到awstats.model.conf檔案可以修改,而該檔案所在目錄為/usr/local/www/awstats/cgi-bin

既然程式只讀固定路徑的話,那就按照他讀取的路徑塞檔案給它

mkdir -pv /usr/local/www/awstats/wwwroot/cgi-bin/;

cp /usr/local/www/awstats/cgi-bin/awstats.model.conf /usr/local/www/awstats/wwwroot/cgi-bin/

重跑一次設定,在上一次出的問題點按ENTER讓他跑預設路徑即可

—–> Create config file ‘/etc/awstats/awstats.ip.conf’
Config file /etc/awstats/awstats.ip.conf created.

—–> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/www/awstats/wwwroot/cgi-bin/awstats.pl -update -config=ip
Or if you have several config files and prefer having only one command:
/usr/local/www/awstats/tools/awstats_updateall.pl now
Press ENTER to continue…
A SIMPLE config file has been created: /etc/awstats/awstats.ip.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for ‘ip’ with command:
> perl awstats.pl -update -config=ip
You can also read your statistics for ‘ip’ with URL:
> http://localhost/awstats/awstats.pl?config=ip

Press ENTER to finish…

完成安裝可以,透過剛剛結束安裝前的路徑連結

http://ip/awstats/awstats.pl?config=ipCrontab加入設定,讓時間內更新數據

ee /etc/crontab;

58 * * * * root /usr/local/www/awstats/cgi-bin/awstats.pl -config=ip

以上IP字樣可以用欲安裝的機器IP或DOMAIN替代

結論:

原本要找偵測網站流量的,可以完整監測IP的。

在腦海中就有Awstats的字眼了,不過一直沒有機會架設。

Awstats的流量統計是透過PERL去分析LOG檔案所產生的報表,當然也可以架設在Winodws的平台上。

不過前提是要先有PERL模組的功能可以應用。

下次會再介紹,類似Google Analytics的流量監測工具。PhpMyVisites

Awstats介面功能請參考下面列表:

統計網站:
localhost

撮要
按參觀時間:
每月記錄
每日
星期幾
每小時
按參觀者:
國家
全部列出
主機
全部列出
最近參觀日期
無法反解譯的IP位址
搜尋引擎網站的漫遊器
全部列出
最近參觀日期
瀏覽器統計:
每次參觀所花時間
檔案類別
存取次數
全部列出
入站處
出站處
作業系統
版本
無法得知
瀏覽器
版本
無法得知
參考資訊:
來源網址
由那些搜尋引擎轉介
由那些其他網站轉介
搜尋
用以搜尋的關鍵字句
用以搜尋的關鍵字詞
其他:
雜項
HTTP 狀態碼
找不到的網頁

CommentComment