這東西安裝在FreeBSD還真是有夠麻煩的

1.安裝
cd /usr/ports/www/awstats && make install clean

2. 修改httpd.conf
照安裝時的訊息
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/www/awstats/classes/"
Alias /awstatscss "/usr/local/www/awstats/css/"
Alias /awstatsicons "/usr/local/www/awstats/icons/"
ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"
     
#    
# This is to permit URL access to scripts/files in AWStats directory.

<Directory "/usr/local/www/awstats/">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

3. 修改主程式
/usr/local/www/awstats/tools/awstats.configure.pl 
把全部的wwwroot/ 都幹掉 (蠻多的)

4. 建立lib目錄
mkdir /var/lib/awstats 
chmod 777 /var/lib/awstats

請確定 /var/lib 本身的權限!!! , 我在這邊被婊很大 , 原本/var/lib 是750 , 要改成755

5. awststs設定檔
/usr/local/www/awstats/tools/awstats_configure.pl

Do you want to continue setup from this NON standard directory [yN] ? y

Config file path ('none' to skip web server setup):
> /usr/local/etc/apache22/httpd.conf

Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

Directory path to store config file(s) (Enter for default):
> /usr/local/etc/awstats

Your web site, virtual server or profile name:
> www.aaa.com.tw

設定檔完成

6. 手動修改設定檔 
awstats.www.aaa.com.tw.conf

1. LogFile要改
2. AllowAccessFromWebToFollowingIPAddresses="允許觀看記錄的IP"
3. lang=tw
4. LogFormat=4  <--- 我的apache不是用combined , 又被婊一次

7. 產生報表檔
# /usr/local/www/awstats/cgi-bin/awstats.pl -config=www.aaa.com.tw 

Direct access after last parsed record (after line 1216375)
Jumped lines in file: 1216375
 Found 1216375 already parsed records.
Parsed lines in file: 209
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 209 new qualified records.

8. 網址
http:/www.aaa.com.tw/awstats/awstats.pl?config=www.aaa.com.tw
創作者介紹
創作者 mool 的頭像
mool

mool

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