Wednesday, June 2, 2010

Install AWStats on CentOS 5

SkyHi @ Wednesday, June 02, 2010

This page summarizes how to perform a basic installation of AWStats on CentOS 5. This tutorial assumes you are either logged in as root or have sudo.

Contents

[hide]

Install

Add RPMForge Yum Repository

Install & Configure Prerequisites

  • Install Apache
    • yum install httpd
  • Configure Apache to start on boot
    • /sbin/chkconfig --levels 345 httpd on
  • Configure iptables to allow Apache traffic
    • /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
    • /etc/init.d/iptables save
    • /etc/init.d/iptables restart

Install & Configure AWStats

  • Install AWStats
    • yum install awstats
  • Modify AWStats Apache Configuration
    • Edit /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/

ScriptAlias /awstats/ /var/www/awstats/

DirectoryIndex awstats.pl
Options ExecCGI
order deny,allow
allow from all

  • Edit the following lines in the default awstats configuration file
    • /etc/awstats/awstats.localhost.localdomain.conf
SiteDomain="."

HostAliases=""
  • Rename config file
    • mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats...conf
  • Update Statistics (Note: By default, statistics will be updated every hour.)
    • /usr/bin/awstats_updateall.pl now -confdir="/etc" -awstatsprog="/var/www/awstats/awstats.pl"
  • Start Apache
    • /etc/init.d/httpd start

Verify Install

  • Go to
    http://./awstats/awstats.pl?config=.