Difference between revisions of "Setup AWStats"

From rdkwiki
Jump to: navigation, search
 
m
 
Line 3: Line 3:
  
 
== Installing prerequisites ==
 
== Installing prerequisites ==
* '''sudo yum install epel-release''' --> install EPEL-repository (Extra Packages for Enterprise Linux)
+
* '''yum install epel-release''' --> install EPEL-repository (Extra Packages for Enterprise Linux)
  
 
== Installing and configuring AWStats ==
 
== Installing and configuring AWStats ==
* '''sudo yum install awstats''' --> install the AWStats software
+
* '''yum install awstats''' --> install the AWStats software
* '''sudo nano /etc/httpd/conf.d/awstats.conf''' --> configure AWStats settings
+
* '''nano /etc/httpd/conf.d/awstats.conf''' --> configure AWStats settings
 
  <Directory "/usr/share/awstats/wwwroot">
 
  <Directory "/usr/share/awstats/wwwroot">
 
     Options None
 
     Options None
Line 22: Line 22:
 
     </IfModule>
 
     </IfModule>
 
  </Directory>
 
  </Directory>
* '''sudo cp awstats.localhost.localdomain.conf /etc/awstats/awstats.<sitename>.conf''' --> copy base-configuration-file. repeat for each site!
+
* '''cp awstats.localhost.localdomain.conf /etc/awstats/awstats.<sitename>.conf''' --> copy base-configuration-file. repeat for each site!
* '''sudo nano /etc/awstats/awstats.<sitename>.conf''' --> edit 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: '''LogFile="/var/log/httpd/<sitename>_access_log"'''
 
  change: '''SiteDomain=<host>.<sitename>.<tld>"
 
  change: '''SiteDomain=<host>.<sitename>.<tld>"
* '''sudo /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=<sitename> -update''' --> update AWStats statistics (repeat for each site).
+
* '''/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=<sitename> -update''' --> update AWStats statistics (repeat for each site).
  
 
== Configure AWStats scheduled updates ==
 
== Configure AWStats scheduled updates ==
* '''sudo crontab -e''' --> edit cron configuration
+
* '''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 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.
 
add a line for each site you have configured with AWStats.

Latest revision as of 08:10, 31 October 2016

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.