Check out my first novel, midnight's simulacra!
AWStats: Difference between revisions
From dankwiki
No edit summary |
(apache log perms for awstats) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
* awstats, obviously | * awstats, obviously | ||
* libgeo-ipfree-perl if you want GeoIP lookups, and a database... | * libgeo-ipfree-perl if you want GeoIP lookups, and a database... | ||
** geoip-database, from master (GeoLiteCountry) | ** geoip-database, from master (GeoLiteCountry) and Geo::IPfree | ||
** geoip-database-contrib, from contrib (binary versions of Country, IPv6 Country, City, and ASN) | ** geoip-database-contrib, from contrib (binary versions of Country, IPv6 Country, City, and ASN) and Geo::IP or Geo::IP::PurePerl | ||
*** run geoip-database-contrib_update to update this latter | *** run geoip-database-contrib_update to update this latter | ||
* libnet-xwhois-perl if you want to use the hostinfo plugin | |||
==/etc/logrotate.d/apache== | |||
By default, apache log files are created <tt>root adm 640</tt>. AWStats runs as www-user. You'll either need change adm to www-user, or 640 to 644. | |||
==/etc/awstats/awstats.conf== | ==/etc/awstats/awstats.conf== | ||
* You want LogFormat 1 rather than 4 (assuming you're using [[Apache]]), but this requires some apache config changes... | * You want LogFormat 1 rather than 4 (assuming you're using [[Apache]]), but this requires some apache config changes... | ||
Line 14: | Line 19: | ||
* Add ::1 to HostAliases, along with any values from your ServerAliases directive | * Add ::1 to HostAliases, along with any values from your ServerAliases directive | ||
** Use <nowiki>"REGEX[expr]"</nowiki> for regexes here | ** Use <nowiki>"REGEX[expr]"</nowiki> for regexes here | ||
* Set EnableLockForUpdate, KeepBackupOfHistoricFiles | * Set EnableLockForUpdate, KeepBackupOfHistoricFiles, IncludeInternalLinksInOriginSection, MetaRobot | ||
* Copy /usr/share/doc/awstats/examples/js/awstats_misc_tracker.js to /js/ relative to your webroot | * Copy /usr/share/doc/awstats/examples/js/awstats_misc_tracker.js to /js/ relative to your webroot | ||
** Add the following to [[MediaWiki:Common.js]] in MediaWiki: | ** Add the following to [[MediaWiki:Common.js]] in MediaWiki: | ||
<pre>script type="text/javascript" src="/js/awstats_misc_tracker.js"></script> | <pre>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></pre> | <noscript><img src="/js/awstats_misc_tracker.js?nojs=y" height=0 width=0 border=0 style="display: none"></noscript></pre> |
Latest revision as of 15:51, 5 February 2012
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) and Geo::IPfree
- geoip-database-contrib, from contrib (binary versions of Country, IPv6 Country, City, and ASN) and Geo::IP or Geo::IP::PurePerl
- run geoip-database-contrib_update to update this latter
- libnet-xwhois-perl if you want to use the hostinfo plugin
/etc/logrotate.d/apache
By default, apache log files are created root adm 640. AWStats runs as www-user. You'll either need change adm to www-user, or 640 to 644.
/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, MetaRobot
- Copy /usr/share/doc/awstats/examples/js/awstats_misc_tracker.js to /js/ relative to your webroot
- Add the following to MediaWiki:Common.js in MediaWiki:
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>