This plugin enables users to display the geolocation information, such as country, region, city, ZIP code and time zone derived from the IP addresses.
-
Install Geo::IP2Location libraries from CPAN.
-
Upload ip2location.pm to
/usr/share/awstats/plugins
. -
Open
/etc/awstats/awstats.conf
and insert following line:LoadPlugin="ip2location /usr/share/IP2Location/IP2LOCATION-LITE-DB1.BIN"
**Note: ** Make sure the path to IP2Location database file is correct.
-
Disable any Maxmind GeoIP plugin as AWStats hook can only access by one plugin per time.
-
View the information by accessing "Countries" or "Hosts" from the left menu.
It's recommended to use IP2Location DB11 which includes country, region, city, ZIP code and time zone information.
- IP2Location LITE (Free): https://lite.ip2location.com
- IP2Location Commercial (Comprehensive): https://www.ip2location.com
Use the IPv4 BIN file if you just need to query IPv4 addresses.
Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.