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 www.my.local properly configured.

Steps :

1. Download and install the rpmforge repository.

For x86 (32-bit) systems

    [root@server ~]# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    

For x64 (64-bit) systems

    [root@server ~]# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
    

2. Install AWStats with yum command:

    [root@server ~]# yum --enablerepo=rpmforge install awstats -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: centos.maulvi.net
     * base: centos.maulvi.net
     * epel: ftp.cuhk.edu.hk
     * extras: centos.maulvi.net
     * rpmforge: fr2.rpmfind.net
     * updates: mirror.yourconnect.com
    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: libGeoIP.so.1 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
    =====================================================================================
    Installing:
     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
    
    Installed:
      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
    
    Complete!
    

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/>
        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
        allow from all
    </Directory>
    

4. Rename config file localhost.localdomain.conf to www.my.local.conf

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

5. Modify “SiteDomain” on Line 153 as below

    SiteDomain="www.my.local"
    

6. Modify “HostAliases” on Line 168 as below

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

7. Update Statistics

    [root@server ~]# /usr/bin/awstats_updateall.pl now -confdir="/etc" -awstatsprog="/var/www/awstats/awstats.pl"
    
    [root@server ~]# /usr/bin/awstats_updateall.pl now -confdir="/etc" -awstatsprog="/var/www/awstats/awstats.pl"
    Running '"/var/www/awstats/awstats.pl" -update -config=www.my.local -configdir="/etc/awstats"' to update config www.my.local
    Create/Update database for config "/etc/awstats/awstats.www.my.local.conf" 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

    http://CentOS_server/awstats/awstats.pl?config=www.my.local
    

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

Leave a Reply

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