Setup AWStats
From rdkwiki
Contents
Intro
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 xxx.xxx.xxx.xxx/xx </IfModule> <IfModule !mod_authz_core.c> # Apache x.x Order allow,deny Allow from 127.0.0.1 Allow from xxx.xxx.xxx.xxx/xx </IfModule> </Directory>
- 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/awstats.pl -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/awstats.pl -config=<sitename> -update --> this schedules an statistics update every hour
add a line for each site you have configured with AWStats.