AWStats display country-region plug-in geoip Installation

Source: Internet
Author: User
Tags geoip maxmind

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.