After AWStats is installed by default, it does not have the country or region information to identify visitors. Therefore, you need to install the plug-in to support AWStats to list the countries and regions of visitors for analysis.
Geoip is a national/IP data table for free, and geoipcitylite is a regional data table
Maxmind currently provides geoip and geoipcitylite data packets for free: You can regularly download data from the following addresses every month:
Wget
Http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
Wget
Http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
After download
# Mkdir/var/greip
Move the two files to the new directory and decompress gunzip.
To install geoip, follow these steps:
Download the geoip C library first:
Go to https://www.maxmind.com/download/geoip/api/c/download geoip-1.4.8.tar.gz
#Tar xf GeoIP-1.4.8.tar.gz
CD to enter the extract directory and perform the following operations to install
#./Configure; Make & make install
Next, download the geoip Perl Library:
Go to https://www.maxmind.com/download/geoip/api/perl/download geo-ip-1.40.tar.gz
# Tar xf Geo-IP-1.40.tar.gz
CD to enter the extract directory and perform the following operations to install
#Perl makefile. pl libs = '-L/usr/local/lib'
// This method must be used for installation. I try to add/usr/local/lib to/etc/lD. so. conf. d/geoip. run the conf command and ldconfig, and run the Perl makefile separately. PL still cannot find the C library of geoip, so it can only use Perl makefile. PL libs = '-L/usr/local/lib'
#Make & make install
Last modified/etc/AWStats. IP/hostname. conf
# Vim/etc/AWStats. IP/hostname. conf
# Add the following two lines
Loadplugin = "geoip geoip_standard/var/geoip. dat" # approximately 1422 rows
Loadplugin = "geoip_city_maxmind geoip_standard/var/geoip/geolitecity. dat" # approximately 1432 rows
#Rm-RF/var/lib/AWStats /*# Deleting old statistics
#/Usr/local/AWStats/tools/awstats_updateall.pl now
# Regenerate the data. You can view the monitoring page to obtain the country and region of the visitor.
Reference: http://wangyan.org/blog/howto-setup-geoip-for-awstats.html
Http://www.chedong.com/tech/awstats.html