awstats日誌分析

  • awstats簡介

awstats是免費的一個非常強大的日誌分析工具的Apache日誌文件。 從apache分析日誌後,它以易於理解的圖形格式顯示它們。 awstats是高級Web統計的縮寫,它可以在命令行界面或CGI上運行。

  • 功能

它可以統計您站點的如下信息:

一:訪問量,訪問次數,頁面瀏覽量,點擊數,數據流量等

二:精確到每月、每日、每小時的數據

三:訪問者國家

四:訪問者IP

五:Robots/Spiders的統計

六:訪客持續時間

七:對不同Files type 的統計信息

八:Pages-URL的統計

九:訪客操作系統瀏覽器等信息

十:其它信息(搜索關鍵字等等)

  • 搭建環境

一臺redhat6

awstats安裝包

DNS

apache設置

redhat6默認就裝了apache

# vim /etc/httpd/conf/httpd.conf  //配置文件
Listen:192.168.100.110:80
ServerName:www.benet.com
# service httpd start  //開啓服務

awstats日誌分析
awstats日誌分析

掛載安裝包

# tar zxvf awstats-7.6.tar.gz -C /opt/
# mv /opt/awstats-7.6 /usr/local/awstats  //便於管理

安裝awstats

# cd /usr/local/awstats/tools
 ./awstats_configure.pl  
Config file path ('none' to skip web server setup):
> /etc/httpd/conf/httpd.conf          //輸入配置文件
然後輸入y 
Your web site, virtual server or profile name:
> www.benet.com                       //輸入域名
回車    回車    

awstats日誌分析
awstats日誌分析

安裝DNS

# rpm -ivh /mnt/Packages/bind-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm   //安裝bind
# vim /etc/named.conf 

awstats日誌分析

# vim /etc/named.rfc1912.zones

awstats日誌分析

# cd /var/named/
# cp -p named.localhost benet.com.zone
# vim benet.com.zone 

awstats日誌分析

# service named start   //啓動服務

查看httpd服務裏有無日誌

# vim /etc/httpd/conf/httpd.conf

awstats日誌分析

修改awstats日誌文件

# vim /etc/awstats/awstats.www.benet.com.conf
LogFile="/var/log/httpd/access_log"       //修改訪問日誌文件位置
DirData="/var/lib/awstats"               //awstats 默認不存在(需要創建)
# service httpd restart
# mkdir /var/lib/awstats

awstats日誌分析
awstats日誌分析

瀏覽器進行訪問

http://www.benet.com/awstats/awstats.pl?config=www.benet.com
# cd /usr/local/awstats/tools
./awstats_updateall.pl now   //更新數據

awstats日誌分析

計劃性任務更新數據

# crontab -e
*/5 * * * *  /usr/local/awstats/tools/awstats_updateall.pl now     
每五分鐘統計

優化網頁地址

# cd /var/www/html  撘Apache默認站點 手工編譯安裝站點:/usr/local/apache/hcdocs
# vim aws.html

<html>
 <head>
   <meta http-equiv=refresh content="0;url=http://www.benet.com/awstats/awstats.pl?config=www.benet.com">
 </head>
 <body></body>
</html>

http://www.benet.com/aws.html    使用此地址直接訪問

awstats日誌分析
awstats日誌分析

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章