#apt-get install awstats

cd /etc/awstats/
cp awstats.conf awstats.w1.test..com.conf
cp awstats.conf awstats.w2.test..com.conf

修改內容
#vi awstats.w1.test.com.conf
...
LogFile="/var/log/apache2/access.log"
LogFormat=1
SiteDomain="w1.test.com"
DNSLookup=0
DirCgi="/awstats"

#vi /etc/apache2/site-available/test.com

NameVirtualHost 192.168.1.6:80/usr/lib/cgi-bin/awstats.pl -config=aaa.ns2go.com -update



DocumentRoot /var/www
ServerName 192.168.1.6
ServerAdmin w1@test.com
# ErrorLog logs/test.com-error_log
# CustomLog logs/test.com-access_log common



DocumentRoot /var/www/w1
ServerName w1.test.com
ServerAdmin w1@test.com
CustomLog "/var/log/apache2/w1.test.com.log" combined

Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon/ "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css
ScriptAlias /awstats/ /usr/lib/cgi-bin/


Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Options None
AllowOverride None
Order allow,deny
Allow from All





更新記錄
#/usr/lib/cgi-bin/awstats.pl -config=w1.test.com -update

查看記錄網址
http://aaa.ns2go.com/awstats/awstats.pl?config=w1.test.com

定期執行
vi /etc/crontab
*/5 * *   *  *  root  /usr/lib/cgi-bin/awstats.pl -config=w1.test.com -update
arrow
arrow
    全站熱搜

    Vega 發表在 痞客邦 留言(0) 人氣()