Setup AWStats

From rdkwiki
Jump to: navigation, search


The steps below will configure Awstats on your Apache server with vhosts already configured. (Installing Apache webserver).

Installing prerequisites

  • yum install epel-release --> install EPEL-repository (Extra Packages for Enterprise Linux)

Installing and configuring AWStats

  • yum install awstats --> install the AWStats software
  • nano /etc/httpd/conf.d/awstats.conf --> configure AWStats settings
<Directory "/usr/share/awstats/wwwroot">
   Options None
   AllowOverride None
   <IfModule mod_authz_core.c>
       # Apache x.x
       Require ip
   <IfModule !mod_authz_core.c>
       # Apache x.x
       Order allow,deny
       Allow from
       Allow from
  • cp awstats.localhost.localdomain.conf /etc/awstats/awstats.<sitename>.conf --> copy base-configuration-file. repeat for each site!
  • nano /etc/awstats/awstats.<sitename>.conf --> edit configuration-file. Repeat for each site!
change: LogFile="/var/log/httpd/<sitename>_access_log"
change: SiteDomain=<host>.<sitename>.<tld>"
  • /usr/share/awstats/wwwroot/cgi-bin/ -config=<sitename> -update --> update AWStats statistics (repeat for each site).

Configure AWStats scheduled updates

  • crontab -e --> edit cron configuration
add line: 0 *  *  *  * root /usr/share/awstats/wwwroot/cgi-bin/ -config=<sitename> -update --> this schedules an statistics update every hour

add a line for each site you have configured with AWStats.