Install AWStats on CentOS 5

From CSLabsWiki

Jump to: navigation, search

This page summarizes how to perform a basic installation of AWStats on CentOS 5.

Contents

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 -A INPUT -p tcp --dport 80 -j ACCEPT
    • /sbin/service 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/
<Directory /var/www/awstats/>
        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
        allow from all
</Directory>
  • Edit the following lines in the default awstats configuration file
    • /etc/awstats/awstats.localhost.localdomain.conf
SiteDomain="<server name>.<domain>"

HostAliases="<any aliases for the server>"
  • Rename config file
    • mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.<server name>.<domain>.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://<server name>.<domain>/awstats/awstats.pl?config=<server name>.<domain>
Personal tools