AWStats簡單介紹
AWStats是在Sourcefroge上發展很快的一個基於perl的web日志分析工具。與其他工具相比,其優勢在於
1. 界面友好,可以根據浏覽器直接調用相應的語言界面(支持中文);
2.基於perl,並且很好的解決了跨平台的問題
3. 效率比較高,對於一個日訪問量百萬的網站,是可以承受的
4. 配置方便簡單
5. 可以自由擴展。
頁面可以提供的信息
1、訪問量,訪問次數、頁面浏覽量、點擊數、數據流量等。
2、精確到每月、每日、每小時的數據。
3、訪問者國家。
4、訪問者IP
5、robots/spiders的統計
6、訪問者持續訪問時間
7、文件類型的統計信息
8、客戶的浏覽器信息
……
安裝:
wget http://nchc.dl.sourceforge.net/project/awstats/AWStats/7.0/awstats-7.0.tar.gz
[root@localhost src]# tar xf awstats-7.0.tar.gz -C /usr/local/
[root@localhost src]# cd /usr/local/
[root@localhost local]# mv awstats-7.0 awstats
[root@localhost local]# cd ./awstats/
[root@localhost awstats]# ls
docs README.TXT tools wwwroot
[root@localhost tools]# perl awstats_configure.pl
…………
-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
File awstats.model.conf updated.
-----> 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:
> www.xxx.com
-----> 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 '/etc/awstats/awstats.www.kissing.com.conf'
Config file /etc/awstats/awstats.www.kissing.com.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/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.kissing.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...
A SIMPLE config file has been created: /etc/awstats/awstats.www.kissing.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.kissing.com' with command:
> perl awstats.pl -update -config=www.kissing.com
You can also read your statistics for 'www.kissing.com' with URL:
> http://localhost/awstats/awstats.pl?config=www.xxx.com(等會用這個地址訪問,如果不是本機,將localhost換成本機的IP地址)
Press ENTER to finish...
修改awastats的配置文件
[root@localhost tools]# mkdir /var/lib/awstats
[root@localhost tools]# vi /etc/awstats/awstats.www.xxx.com.conf
[root@localhost tools]# cat /etc/awstats/awstats.www.xxx.com.conf | grep -vnE ^# |less
51:LogFile="/var/log/ppp/access.log"
63:LogType=W
122:LogFormat=1
134:LogSeparator=" "
153:SiteDomain="www.xxx.com"
168:HostAliases="kissing.com www.xxx.com 127.0.0.1 localhost"
188:DNSLookup=2
203:DirData="/var/lib/awstats"
開始分析命令
[root@localhost tools]# /usr/local/awstats/wwwroot/cgi-bin/awstats.
pl --update -config=www.xxx.com
Create/Update database for config "/etc/awstats/awstats.www.kissing.com.conf" by AWStats version 7.0 (build 1.971)
From data in log file "/var/log/ppp/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 1759345
Found 6 dropped records,
Found 0 comments,
Found 0 blank records,
Found 20 corrupted records,
Found 0 old records,
Found 1759319 new qualified records.