- First we will install the Geo::IP::PurePerl perl module. You can download the latest version of this module from following download link.
http://search.cpan.org/search?query=Geo%3A%3AIP%3A%3APurePerl&mode=all
You can also install this module from Windows command line using following command.
ppm install http://trouchelle.com/ppm10/Geo-IP-PurePerl.ppd
- Install the Geo::IPfree perl module. The latest version of this module can be found at following download link.
http://search.cpan.org/search?query=Geo%3A%3AIPFree&mode=all
You can also install this module from Windows command line using following command.
ppm install http://trouchelle.com/ppm10/Geo-IPfree.ppd
- Download the file GeoIP.dat, unzip and install it in GeoIP directory. For instance, C:\GeoIP. Note that, this file must be updated periodicaly, to get the accurate statistics.
- Apply the read permissions to IIS anonymous user (IUSR_<username>) on GeoIP directory.
-
Edit the file, %plesk_dir%\Additional\AWStats\wwwroot\cgi-bin\awstats.model.conf and enable geoip plugin as follows.
LoadPlugin="geoip GEOIP_STANDARD /GeoIP/GeoIP.dat"
-
To recalculate the web statistics for a specific domain, apply following 2 commands. Be sure that you replace "testdomain.tld" with your actual domain name in these commands.
"%plesk_bin%"\statistics.exe --calculate-one --domain-name testdomain.tld
"%plesk_bin%"\statistics.exe --generate-domain-webstat --domain-name testdomain.tld
To calculate the web statistics for all domains, issue the following commands in the same order."%plesk_bin%"\dbclient.exe --direct-sql --sql="select name from domains" > c:\output.txt
for /F %i in (c:\output.txt); do ("%plesk_bin%"\statistics.exe --calculate-one --domain-name %i);
for /F %i in (c:\output.txt); do ("%plesk_bin%"\statistics.exe --generate-domain-webstat --domain-name %i);