How to Install Awstats on CentOS 5.5

In this tutorial i will guide you on how to install AWStats in CentOS server. AWStats is a free powerful tool that generates advanced websites statistics, graphically. This tutorial assumes that you have root access for CentOS with Apache server has been installed with domain properly configured.

Steps :

1. Download and install the rpmforge repository.

For x86 (32-bit) systems

    [root@server ~]# rpm -Uhv

For x64 (64-bit) systems

    [root@server ~]# rpm -Uhv

2. Install AWStats with yum command:

    [root@server ~]# yum --enablerepo=rpmforge install awstats -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons:
     * base:
     * epel:
     * extras:
     * rpmforge:
     * updates:
    addons                                                        |  951 B     00:00
    base                                                          | 1.1 kB     00:00
    epel                                                          | 3.7 kB     00:00
    extras                                                        | 2.1 kB     00:00
    rpmforge                                                      | 1.1 kB     00:00
    updates                                                       | 1.9 kB     00:00
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package awstats.noarch 0:7.0-2.el5.rf set to be updated
    --> Processing Dependency: perl(Geo::IP) for package: awstats
    --> Running transaction check
    ---> Package perl-Geo-IP.i386 0:1.38-1.el5.rf set to be updated
    --> Processing Dependency: for package: perl-Geo-IP
    --> Running transaction check
    ---> Package geoip.i386 0:1.4.6-1.el5.rf set to be updated
    --> Finished Dependency Resolution
    Dependencies Resolved
     Package             Arch           Version                   Repository        Size
     awstats             noarch         7.0-2.el5.rf              rpmforge         1.2 M
    Installing for dependencies:
     geoip               i386           1.4.6-1.el5.rf            rpmforge         782 k
     perl-Geo-IP         i386           1.38-1.el5.rf             rpmforge         118 k
    Transaction Summary
    Install       3 Package(s)
    Upgrade       0 Package(s)
    Total download size: 2.1 M
    Downloading Packages:
    (1/3): perl-Geo-IP-1.38-1.el5.rf.i386.rpm                     | 118 kB     00:01
    (2/3): geoip-1.4.6-1.el5.rf.i386.rpm                          | 782 kB     00:13
    (3/3): awstats-7.0-2.el5.rf.noarch.rpm                        | 1.2 MB     00:23
    Total                                                 52 kB/s | 2.1 MB     00:41
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : geoip                                                         1/3
      Installing     : perl-Geo-IP                                                   2/3
      Installing     : awstats                                                       3/3
      awstats.noarch 0:7.0-2.el5.rf
    Dependency Installed:
      geoip.i386 0:1.4.6-1.el5.rf            perl-Geo-IP.i386 0:1.38-1.el5.rf

3. Modify AWStats Apache Configuration

    [root@server ~]# vi /etc/httpd/conf.d/awstats.conf
    Alias /awstats/icon/ /var/www/awstats/icon/
    ScriptAlias /awstats/ /var/www/awstats/
    <Directory /var/www/awstats/>
        Options ExecCGI
        order deny,allow
        allow from all

4. Rename config file localhost.localdomain.conf to

    [root@server ~]# mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/

5. Modify “SiteDomain” on Line 153 as below


6. Modify “HostAliases” on Line 168 as below

    HostAliases="localhost REGEX[my\.local$] REGEX[^10\.0\.0\.]"

7. Update Statistics

    [root@server ~]# /usr/bin/ now -confdir="/etc" -awstatsprog="/var/www/awstats/"
    [root@server ~]# /usr/bin/ now -confdir="/etc" -awstatsprog="/var/www/awstats/"
    Running '"/var/www/awstats/" -update -configdir="/etc/awstats"' to update config
    Create/Update database for config "/etc/awstats/" by AWStats version 7.0 (build 1.971)
    From data in log file "/var/log/httpd/access_log"...
    Phase 1 : First bypass old records, searching new record...
    Searching new records from beginning of log file...
    Jumped lines in file: 0
    Parsed lines in file: 0
     Found 0 dropped records,
     Found 0 comments,
     Found 0 blank records,
     Found 0 corrupted records,
     Found 0 old records,
     Found 0 new qualified records.

8. Restart the apache service

    [root@server ~]# /etc/init.d/httpd start

8. Verify Install


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>