close

   Webalizer 是一個好用的網站流量分析軟體,它可以分析 Apache server 產生的log 紀錄檔也可以分析FTP 的 Log 檔,並做出相當精美的HTML網頁輸出,目前是很多網頁主機做流量分析統計之用,所以以下我們來看看如何安裝...

yum -y install webalizer
cp /etc/httpd/conf.d/webalizer.conf /etc/httpd/conf.d/webalizer.conf.bak
vi /etc/httpd/conf.d/webalizer.conf

Alias /usage /var/www/usage


<Location /usage>
Order deny,allow
Deny from all
Allow from
127.0.0.1修改成--> Allow from 172.16.1.0/255.255.255.0(或對外IP)
Allow from ::1
# Allow from .example.com
</Location>

/usr/bin/webalizer
/etc/rc.d/init.d/httpd restart

設定檔放在 /etc/webalizer.conf 我的設定如下

LogFile /var/log/httpd/access_log
OutputDir /var/www/html/webalizer
HistoryName /var/lib/webalizer/webalizer.hist
Incremental yes
IncrementalName /var/lib/webalizer/webalizer.current
HostName www.hfpchurch.org.tw
PageType htm*
PageType cgi
PageType php
PageType shtml
DNSCache /var/lib/webalizer/dns_cache.db
DNSChildren 10
Quiet yes
FoldSeqErr yes
HideURL *.gif
HideURL *.GIF
HideURL *.jpg
HideURL *.JPG
HideURL *.png
HideURL *.PNG
HideURL *.ra
SearchEngine yahoo.com p=
SearchEngine altavista.com q=
SearchEngine google.com q=
SearchEngine eureka.com q=
SearchEngine lycos.com query=
SearchEngine hotbot.com MT=
SearchEngine msn.com MT=
SearchEngine infoseek.com qt=
SearchEngine webcrawler searchText=
SearchEngine excite search=
SearchEngine netscape.com search=
SearchEngine mamma.com query=
SearchEngine alltheweb.com query=
SearchEngine northernlight.com qr=

apache 設定安全目錄

<Directory “/var/www/html/webalizer”>
Options None
AllowOverride None

Order deny,allow
Allow from 118.163.57.0/255.255.255.0

< /Directory>

新增資料夾

mkdir /var/www/html/webalizer

然後請執行  

/usr/bin/webalizer -c /etc/webalizer.conf

如果沒有顯示什麼訊息 表示成功了

設定crontab ..讓它每二小時跑一次:

#
#run apache log
#
00 */2 * * * root /usr/bin/webalizer -c /etc/webalizer.conf

   7  

arrow
arrow
    全站熱搜

    翰 發表在 痞客邦 留言(1) 人氣()