There is a rumor that GeoIP is not supported by Powweb. This is
completely false. It must first be configured prior to use. Now stay
with me so I don’t lose you…
Install your own copy of
awstats in the cgi-bin directory. Once this is working properly, you
may move on to the next step. There is a tutorial for this on the
Powweb site under “Site Statistics” I believe.
Download GeoIP::PurePerl module from Maxmind.com
1.17 is the latest version as of Sept 1, 2005. This is a tar.gz file so make sure you have WinRAR or another compatible decompressor.
decompressed, create a directory in your cgi-bin called GeoIP (You can
name it anything you like, but for this tutorial it shall be GeoIP).
Move the contents from the decompressed folder to “/cgi-bin/GeoIP/”.
The decompressed folder should be called “Geo-IP-PurePerl-1.xx”. Now
before we configure we need to get the latest database.
Download GeoIP.dat from this address
Again this is a .gz file and must be decompressed. Once decompressed, move “GeoIP.dat” to “/cgi-bin/GeoIP/”.
OK.. now to configure.
First if you have turned on DNSLookup… turn it
off. In Awstats.conf —> DNSLookup=0 (this may also be a good time
to change your logfile if you desire current stats over stats from
yesterday. Remove the “.0″ after “access”.
Next enable the
GeoIP plugin by removing the # from before the command and add the path
to the GeoIP.dat file. In Awstats.conf —> LoadPlugin=”geoip
GEOIP_STANDARD /www/u/username/cgi-bin/GeoIP/GeoIP.dat” When that’s
complete, save awstats.conf
Now open up the geoip.pm file
(located in awstats/plugins…. thanx Aza) so we may edit it. At the
very top you’ll see two directory entries. They’ll say “Geo/IP.pm” and
Geo/IP/PurePerl.pm”. WE need to modify these to reflect the
installation path. Change them to
Save and close.
Last but not least, open up “PurePerl.pm”
located in “/cgi-bin/GeoIP/lib/Geo/IP”. On lines 79 and 83 you’ll fine
directory listings for “GeoIP.dat”. Change these to
“/www/u/username/cgi-bin/GeoIP/GeoIP.dat”. Save and close.
Everything should be set now.
If it’s working, you’ll see a new column
added to “Hosts” in Awstats named “GeoIP Country”. This will list
countries for all IP addresses, even ones collected before
modification. The “Countries” area will show flags only for IP
addresses collected after the modification. If you have trouble, set
your crontab to execute awstats every minute. This is accomplished be
setting time to *. Then check your cronlog located in your logs
folder to view errors.