INSTALL AND CONFIGURE AWSTATS ON CENTOS

AWStats is a free tool that use to create statistics by examining Apache log information, ftp or mail web servers. In this article we will guide you to install and configure AWStats on CentoOS, RHEL systems.

Step 1 is to Install EPEL repository using below commands on CentOS Systems.

CentOS/RHEL 6:
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

CentOS/RHEL 5:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Install AWStats package using yum. Its will also install all other required dependencies.

yum install awstats

By default AWStats creates an Apache configuration file /etc/httpd/conf.d/awstats.conf.

Default settings is good to go except allow from access. If you need to access AWStats from network, upgrade the allow from ip with your system IP from where you need to access it.

nano /etc/httpd/conf.d/awstats.conf

Edit the file named /etc/httpd/conf.d/awstats.conf with line below:

Alias /awstats/icon/ /var/www/awstats/icon/
ScriptAlias /awstats/ /var/www/awstats/
<Directory "/var/www/awstats/">
 DirectoryIndex awstats.pl
 Options ExecCGI
 order deny,allow
 deny from all
 allow from 127.0.0.1
 allow from 192.168.1.0/24
</Directory>

#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/
Now restart the Apache services:

service httpd restart
Rename the configuration file to the correct one,and make changes as below:

cp /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.tecadmin.net.conf
nano /etc/awstats/awstats.tecadmin.net.conf

Update the Statistics:

/usr/bin/awstats_updateall.pl now -confdir=”/etc” -awstatsprog=”/var/www/awstats/awstats.pl”

Done.