User Tools

Site Tools


blog:configure_awstats_on_debian_webserver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
blog:configure_awstats_on_debian_webserver [2010-06-29 15:39] – created brbblog:configure_awstats_on_debian_webserver [2010-10-24 10:29] (current) brb
Line 3: Line 3:
 AWStats on Debian AWStats on Debian
  
-    * Install AWStats +Install AWStats  
 +  aptitude update 
 +  aptitude awstats
  
-aptitude update +Configure the apache2 for awstats
-aptitude awstats+
  
-    * Configure the apache2 for awstats +Copy configuration file for apache2.  
-    * Copy configuration file for apache2. +  cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats
  
-cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats+Then edit /etc/awstats/awstats.conf file and make sure the file contains (double check the apache2 word) 
  
-    *+  LogFile="/var/log/apache2/access.log" 
 +  SiteDomain="mysite.org" 
 +  LogFormat=1
  
-      Then edit /etc/awstats/awstats.conf file and make sure the file contains (double check the apache2 word) +Now change a permission on apache log file  
 +  chmod o+r /var/log/apache2/access.log
  
-LogFile="/var/log/apache2/access.log+Make it a default that access.log has these permissions.
-SiteDomain="mysite.org" +
-LogFormat=1+
  
-    * Now change a permission on apache log file +Locate the awstats_updateall.pl script (it is in /usr/share/doc/awstats/examples on debian) and make a symlink to /usr/local/bin for it. 
  
-chmod o+r /var/log/apache2/access.log +Edit the /etc/logrotate.d/apache2 and make sure it has these lines  
- +  create 644 root adm 
-    * Make it a default that access.log has these permissions. +  prerotate 
-    * +        nice /usr/local/bin/awstats_updateall.pl -awstatsprog=/usr/lib/cgi-bin/awstats.pl now                                                                                     
- +
-      Edit the /etc/logrotate.d/apache2 and make sure it has these lines  +
- +
- create 644 root adm +
- +
-    * And  +
- +
-prerotate +
-    /usr/lib/cgi-bin/awstats.pl -config=awstats.www.mysite.org.conf  -update+
   endscript   endscript
  
-    * Final file should look similar to : +Final file should look similar to : 
  
 +<code>
 /var/log/apache2/*.log { /var/log/apache2/*.log {
         weekly         weekly
Line 50: Line 44:
         sharedscripts         sharedscripts
         prerotate         prerotate
-            /usr/lib/cgi-bin/awstats.pl -config=awstats.conf -update        endscript+           nice /usr/local/bin/awstats_updateall.pl -awstatsprog=/usr/lib/cgi-bin/awstats.pl 
         postrotate         postrotate
                 if [ -f /var/run/apache2.pid ]; then                 if [ -f /var/run/apache2.pid ]; then
Line 57: Line 51:
         endscript         endscript
 } }
 +</code>
  
-    * Reload apache  +Add the update command to cron.hourly: 
- +  nice /usr/local/bin/awstats_updateall.pl -awstatsprog=/usr/lib/cgi-bin/awstats.pl 
-/etc/init.d/apache2 reload +
- +
-    * And visit: +
  
-http://localhost/cgi-bin/awstats.pl?config=awstat.conf or http://www.mysite.com/cgi-bin/awstats.pl?config=awstat.conf [Optional]+Reload apache  
 +  /etc/init.d/apache2 reload
  
-    *+And visit:  
 +  http://localhost/cgi-bin/awstats.pl?config=awstat.conf or http://www.mysite.com/cgi-bin/awstats.pl?config=awstat.conf [Optional]
  
-      To make it easier to remember the address you can edit /etc/apache2/conf.d/awstats and add this line. +To make it easier to remember the address you can edit /etc/apache2/conf.d/awstats and add this line.  
 +  RedirectMatch ^/logs /cgi-bin/awstats.pl
  
-RedirectMatch ^/logs /cgi-bin/awstats.pl?config=awstat.conf+Now you can access the awstats statistics by going to  
 +  http://www.mysite.com/logs
  
-    * Now you can access the awstats statistics by going to +If you have a lot of old compressed logfiles that you would to include, set the logfile path to
 +  LogFile="zcat /var/log/apache2/servername.tld-access.log.*.gz |"
  
-http://www.mysite.com/logs+And update the databaseThis will incorporate all old log entriesDon't forget to switch back to the last logfile!
  
-    * Done+Ref: http://wiki.debian.org/Manual-Howto
  
-{{tag>}}+{{tag>linux apache awstats}}
  
 ~~LINKBACK~~ ~~LINKBACK~~
 ~~DISCUSSION~~ ~~DISCUSSION~~
  
blog/configure_awstats_on_debian_webserver.1277818777.txt.gz · Last modified: 2010-06-29 15:39 by brb