Check out my first novel, midnight's simulacra!

AWStats

From dankwiki
Revision as of 08:14, 25 November 2011 by Dank (talk | contribs)

AWStats provides some nice web log visualization, but can be painful to set up...

Packages

  • awstats, obviously
  • libgeo-ipfree-perl if you want GeoIP lookups, and a database...
    • geoip-database, from master (GeoLiteCountry)
    • geoip-database-contrib, from contrib (binary versions of Country, IPv6 Country, City, and ASN)
      • run geoip-database-contrib_update to update this latter

/etc/awstats/awstats.conf

  • You want LogFormat 1 rather than 4 (assuming you're using Apache), but this requires some apache config changes...
    • FIXME detail?
  • Set SiteDomain appropriately (use your ServerName from apache config).
    • Consider rewriting all URI's to your ServerName using mod-rewrite.
  • Add ::1 to HostAliases, along with any values from your ServerAliases directive
    • Use "REGEX[expr]" for regexes here
  • Set EnableLockForUpdate, KeepBackupOfHistoricFiles, IncludeInternalLinksInOriginSection
  • Copy /usr/share/doc/awstats/examples/js/awstats_misc_tracker.js to /js/ relative to your webroot
script type="text/javascript" src="/js/awstats_misc_tracker.js"></script>
<noscript><img src="/js/awstats_misc_tracker.js?nojs=y" height=0 width=0 border=0 style="display: none"></noscript>