Linux, 工作, 生活, 家人

UNIX

awstats 在 Gentoo 的設定

awstats 看起來很難,事實上並不難,只是在 Gentoo 裝要一些小動作,會跑得比較順

#emerge awstats
#cd /etc/awstats
新增設定檔
#cp awstats.model.conf awstats.www.techarea.org.conf
www.techarea.org 代換成你自己的 site
以下是重要設定
LogFile=”/var/log/apache2/access_log”
LogFormat=4
SiteDomain=”www.techarea.org”
HostAliases=”localhost 127.0.0.1 REGEX[techarea\.org$] REGEX[poorman\.org$]”
DNSLookup=1
DirIcons=”/awstatsicons”
LoadPlugin=”tooltips”
以上 HostAlias 如果不設,就是 HostAliases=”localhost 127.0.0.1 $SiteDomain”
DNSLookup 我設開啟,記得將你的 DNS Server 指到 168.95.192.2(Hinet 新的 DNS)
狂操一下吧 :p
我的 web 是放在 /home/httpd/html/awstats (Redhat 6.0 時代的遺毒)
修改 icon 下的mode 設定
#chmod +x /usr/share/webapps/awstats/6.1/htdocs\icon
修改 apache2 的設定
新增一個檔案到
/etc/apache2/conf/awstats.conf
內容如下

Options +ExecCGI +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

Alias /awstatsclasses “/usr/share/webapps/awstats/6.1/htdocs/classes/”
Alias /awstatscss “/usr/share/webapps/awstats/6.1/htdocs/css/”
Alias /awstatsicons “/usr/share/webapps/awstats/6.1/htdocs/icon/”
在 /etc/apache2/conf/apache2.conf 內加入
Include conf/awstats.conf
然後重開 apache

最後寫一隻 script 放在
/etc/cron.daily/awstat.sh
內容如下
WORKPATH=”/home/httpd/html/awstats”
AWSTATBIN=”/usr/share/webapps/awstats/6.1/hostroot/cgi-bin/awstats.pl”

cd $WORKPATH
for WEB in “www.techarea.org”
do
perl $AWSTATBIN -config=$WEB -update
awstats_buildstaticpages.pl -lang=tw -config=$WEB -dir=$WORKDIR
done
記得 WORKPATH 要改成你自己的目錄
這樣以後就可以 COPY 後,支援多台設定 :p

參考文件 Gentoo 中文 awstats

發佈留言