×
Orchidbox
← Tools

AWstats – An Alternative to Google Analytics and Great Tool to Diagnose Issue

[ Updated April 21, 2024 ]

Sometimes Google Analytics doesn’t quite fit your needs – it can slow your site down (due to too many JS calls), or you can find it simply isn’t reliable enough.

If you are looking for a FREE and easy to use server side analytics package that tracks basic stats like:

  • Number of visits, and number of unique visitors,
  • Visits duration and last visits,
  • Authenticated users, and last authenticated visits,
  • Days of week and rush hours (pages, hits, KB for each hour and day of week),
  • Domains/countries of hosts visitors (pages, hits, KB, 269 domains/countries detected, GeoIp detection),
  • Hosts list, last visits and unresolved IP addresses list,
  • Most viewed, entry and exit pages,
  • Files type,
  • Browsers used (pages, hits, KB for each browser, each version (Web, Wap, Media browsers: 97 browsers, more than 450 if using browsers_phone.pm library file),
  • Search engines, keyphrases and keywords used to find your site

 

AWstats is what you need. AW Stats is basically a log analyser which works as a CGI or from command line and shows you all possible information your log contains in few graphics and web pages.

It uses a partial information file to be able to process large log files, often and quickly. It can analyse log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp server.

More importantly AWstats gives you what Analytics will never be able to provide: Http error codes.

As matter of fact Google Analytics can give you stats only on successfully returned pages (RC: 200); it is pretty much useless to diagnose 500 server errors, 404s and 403s.

Furthermore there is a rumour in the SEO community that Google uses Google Analytics data (in particular Bounce Rate) to rate your site. The GA urban legend states that if you have got an high bounce rate you might get penalised. For this reason these believers don’t use Google Analytics but AWstats instead.

Other stats that Google Analytics can’t provide:

  • Cluster report for load balanced servers ratio.
  • Visits of robots (more than 300 robots detected),
  • Worms attacks

GUIDE ON HOW TO INSTALL AWSTATS ON UBUNTU

sudo aptitude install awstats
To see the country of your visitors (not required)

sudo aptitude install libnet-ip-perl
sudo aptitude install libgeo-ipfree-perl
Configuration

Let’s assume you want to analyse the Apache 2 log file of your website “site.com” (It can be just an IP address).

Create configuration file

sudo cp /etc/awstats/awstats.conf /etc/awstats/awstats.site.com.conf

Update these parameters

# apache2
LogFile=”/var/log/apache2/access.log”

# domain name
SiteDomain=”site.com”
HostAliases=”localhost 127.0.0.1 site.com”

LogFormat=1
You can also activate these plugins

LoadPlugin=”tooltips
LoadPlugin=”geoipfree”
Run

sudo /usr/lib/cgi-bin/awstats.pl -config=site.com -update

You should get something like this

Create/Update database for config “/etc/awstats/awstats.site.com.conf” by AWStats version 6.7 (build 1.892)
From data in log file “/var/log/apache2/access.log”…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 191338
Found 0 dropped records,
Found 24 corrupted records,
Found 0 old records,
Found 191314 new qualified records.
Configure Apache to view the statistics

Create /etc/apache2/conf.d/statistics

Alias /awstatsclasses “/usr/share/awstats/lib/”
Alias /awstats-icon/ “/usr/share/awstats/icon/”
Alias /awstatscss “/usr/share/doc/awstats/examples/css”
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /statistics/ /usr/lib/cgi-bin/
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Restart Apache

sudo /etc/init.d/apache2 restart

View your statistics

https://site.com/statistics/awstats.pl
or (in case you have more than one config file)

https://site.com/statistics/awstats.pl?config=site.com

Disclaimer

Orchid Box doesn’t receive any money, freebies or any sort of payment from AWstats. This is a genuine recommendation from our agency.

You may also like...

Let's Talk