User Tools

Site Tools


blog:configure_awstats_on_debian_webserver

This is an old revision of the document!


Configure awstats on debian webserver

AWStats on Debian

  • Install AWStats

aptitude update aptitude awstats

  • Configure the apache2 for awstats
  • Copy configuration file for apache2.

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

  • Now change a permission on apache log file

chmod o+r /var/log/apache2/access.log

  • Make it a default that access.log has these permissions.
    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
  • Final file should look similar to :

/var/log/apache2/*.log {

      weekly
      missingok
      rotate 52
      compress
      delaycompress
      notifempty
      create 644 root adm
      sharedscripts
      prerotate
          /usr/lib/cgi-bin/awstats.pl -config=awstats.conf -update        endscript
      postrotate
              if [ -f /var/run/apache2.pid ]; then
                      /etc/init.d/apache2 restart > /dev/null
              fi
      endscript

}

  • 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. 

RedirectMatch ^/logs /cgi-bin/awstats.pl?config=awstat.conf

  • Now you can access the awstats statistics by going to

http://www.mysite.com/logs

  • Done.

~~LINKBACK~~

Discussion

Enter your comment. Wiki syntax is allowed:
   __    ____   ____   __   ____ 
  / /   / __/  / __/  / /  / __ \
 / /__ _\ \   _\ \   / /__/ /_/ /
/____//___/  /___/  /____/\___\_\
 
blog/configure_awstats_on_debian_webserver.1277818777.txt.gz · Last modified: 2010-06-29 15:39 by brb