AWStats on Fedora Core 4

February 16, 2007 by hejian

1. Install AWStats

yum install awstats

2. Setup the domain’s AWStats config file

cd /etc/awstats
cp awstats.model.conf awstats.yourdomain.conf

Edit this new config file and setup these things:

# A full path of your apache log file
LogFile="/var/www/vhosts/yourdomain/statistics/logs/access_log"
# It should be "W" for analyzing web log files.
LogType=W
# Enter here your log format (Must match your web server config)
LogFormat=1
# must contain the main domain name
SiteDomain="yourdomain.com"
# all other possible domain names, addresses or virtual host aliases
HostAliases="www.yourdomain.com localhost 127.0.0.1"

3. Building statistics database
The first log analysis should be done manually from the command line:

perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=yourdomain -update

4. Security setting for each domain
Edit /etc/httpd/conf.d/awstats.conf adding these settings:

<Files "awstats.pl">
AuthUserFile /path/to/.passwd
AuthGroupFile /path/to/.group
AuthName "Restricted Area For Customers"
AuthType Basic
require valid-user
</Files>

Edit each domain’s awstats config file:
1. set AllowAccessFromWebToAuthenticatedUsersOnly to 1
2. edit list of authorized users in the AllowAccessFromWebToFollowingAuthenticatedUsers parameter.

5. Let domains/contries work
Editing file /etc/yum.repos.d/dries.repo:

[dries]
name=Extra Fedora rpms dries - $releasever - $basearch
baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/linux/$release ver/$basearch/dries/RPMS/
http://apt.sw.be/dries/fedora/fc4/$basearch/dries/RPMS/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://dries.ulyssis.org/rpm/RPM-GPG-KEY.dries.txt

install the Geo-IPfree:

yum install perl-Geo-IPfree

Edit AWStats configure file, LoadPlugin=”geoipfree”

Leave a Reply

You must be logged in to post a comment.

Wordpress template made by HeJian