Web Site Statistics

Installing AWstats

Step 1.   Download the stats program: Awstats

# cd /usr/local/src
# wget  https://prdownloads.sourceforge.net/awstats/awstats-7.6.tar.gz
#  gzip -d  awstats-7.6.tar.gz
#  tar xvf  awstats-7.6.tar

As the configure script edits the apache2 configuration file and a few other things I am not sure about, I simply set it up directly.

And in case like me, you thought this might need mod_perl for speed… it turns out that it does not really need it here.  This is because these work machines ( for the time being anyway ) will only be running AWstats once a day at around 3am.  Thus its speed of running it not so important to anyone actually using the machine for work.  So skip it, if you like.

------------- not needed ----------------
Download and install mod_perl !
cd /usr/local/src
wget http://mirror.intergrid.com.au/apache/perl/mod_perl-2.0.10.tar.gz
gzip -d ..
tar xvf ..
cd  mod_perl-2.0.10
% perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
  % make && make test
  % make install
/usr/local/src/mod_perl-2.0.10 # perl Makefile.PL MP_APXS=/usr/bin/apxs

  ************* WARNING *************
  Your Perl is configured to link against libgdbm,
  but libgdbm.so was not found.
  You could just symlink it to /usr/lib/x86_64-linux-gnu/libgdbm.so.3.0.0

aptitude install libgdbm-dev
and re-run the perl script
agt-get install libgdbm3
apt-get install libperl-dev

---------------------

Step 2.  Configure

# mkdir /etc/awstats   ( where awstats defaults to look for configuation files ) 
#  cp   /usr/local/src/awstats-7.6/wwwroot/cgi-bin/awstats.model.conf    \
           /usr/awstats/awstats.jamesharryburton.com.conf
( assuming the name of our domain is jamesharryburton.com )

# mkdir /usr/local/blogs/jhb/awstats  
               ( this is where the awstats run time “awstats.pl” 
                 will now put the updated stats when run from cron.daily )

#  cd /etc/awstats
#  vi   awstats.jamesharryburton.com.conf 
        ( make these changes to this configuation file )
LogFile="/var/log/apache2/jhb_access.log"  ( check httpd.conf )
SiteDomain="jamesharryburton.com"
DirData="/usr/local/blogs/jhb/awstats/"        

Step 3.  Initial run.

# cd /usr/local/blogs/jhb
#  ln -s /usr/local/src/awstats-7.6/wwwroot/icon icon  ( so the icons appear )
#  cd  /usr/local/src/awstats-7.6/wwwroot/cgi-bin 
#  ./awstats.pl -config=jamesharryburton.com       \
                   -update                                                    \
                   -output > /usr/local/blogs/jhb/awstats.html
This will then appear in the browser as http://jamesharryburton.com/awstats.html

Step 4.  Schedule a daily run.

#  crontab -e

5 3 * * * /usr/local/src/awstats-7.6/wwwroot/cgi-bin/awstats.pl  -config=jamesharryburton.com -update -output > /usr/local/blogs/jhb/awstats.html

( say at 5 minutes past 3am each day )

Also need to add an entry for each and every web site hosted that would like stats.

7 3 * * * /usr/local/src/awstats-7.6/wwwroot/cgi-bin/awstats.pl  -config=programmer.com.au -update -output > /usr/local/blogs/programmer/awstats.html

Step 5.  Schedule log file rotations……

Explained here.

© 2017, James Harry Burton. All rights reserved.