Advanced Web Statistics

AWStats reads the raw Apache logfiles and parses them to give you detailed information about visitors.


  • Download the tarball and unpack it into /usr/local/awstats
  • Make new directory /var/lib/awstats to store the data.
  • Run /usr/local/awstats/tools/ to setup initial configuration.
  • Create awstats HTML directory
  • Setup apache
  • Setup cron job
  • Build stats
Awstats configuration script


> /etc/apache2/httpd.conf
> y
> [Enter for default]

Creates file /etc/awstats/

Update stats:

/usr/local/awstats/wwwroot/cgi-bin/ now

Apache Configuration

Copy /usr/local/awstats/webroot to wherever the awstats docs are viewable.

Alias /awstats "/var/www/localhost/htdocs/awstats"
<Directory "/var/www/localhost/htdocs/awstats">
AllowOverride None
Options None
Order deny,allow
Deny from all
Allow from
Allow from
CPanel Integration

On some CentOS installations, with CPanel installed, you'll need to edit a specific file to get the AWStats alias working:


AWStats Configuration

You can use the sample config above, or use the config script to create a new one. Here are some configuration variables you are most likely to want to change:

  • LogFile=“/usr/local/awstats/tools/ /var/log/apache2/*_log”
  • DetailedReportsOnNewWindows=0 (removes _target in links)
  • LogFormat=1 (combined)
  • LogFormat=4 (common)

Initial Run, Cron Job

You will need to run the awstats script to build the stats at least once.

Also, you can setup a cron job to execute it nightly.

/usr/local/awstats/tools/ \
-update -dir=/var/www/localhost/htdocs/awstats &> /dev/null