Applicable to:
- Plesk for Linux
Question
How to configure AWStats to show which countries visitors are from?
Answer
By default, AWStats does not show visitors by countries.
If you wish to see this functionality in AWStats for Plesk out of the box, please vote for this feature on Plesk UserVoice:
To enable this feature manually, configure the GeoIP plugin as follows:
-
Connect to your Plesk server via SSH.
-
Install
perl-CPAN
package:# yum install perl-CPAN
-
Install the GeoIP module using these two commands:
# perl -MCPAN -e "install Geo::IP::PurePerl"
# perl -MCPAN -e "install Geo::IP"
-
Run these commands to uncomment the plugin in AWStats configuration files:
# /bin/sed -ire '/GeoIP.dat/ s/^#//' /etc/awstats/awstats.conf
# /bin/sed -ire '/GeoIP.dat/ s/^#//' /etc/awstats/awstats.model.conf
-
Run these commands to correct the path:
# /bin/sed -i 's/\/pathto\/GeoIP.dat/\/usr\/share\/GeoIP\/GeoIP.dat/g' /etc/awstats/awstats.conf
# /bin/sed -i 's/\/pathto\/GeoIP.dat/\/usr\/share\/GeoIP\/GeoIP.dat/g' /etc/awstats/awstats.model.conf
-
Run this command to uncomment the line for all existing domains which are using AWstats:
# for file in /usr/local/psa/etc/awstats/*; do /bin/sed -ire '/GeoIP.dat/ s/^#//' "$file"; echo "$file is updated"; done
-
Run this command to correct path to GeoIP plugin:
# for file in /usr/local/psa/etc/awstats/*; do /bin/sed -i 's/\/pathto\/GeoIP.dat/\/usr\/share\/GeoIP\/GeoIP.dat/g' "$file"; echo "$file is updated"; done
-
Recalculate web statistics for all existing domains:
# plesk sbin statistics --generate-all-webstat
# plesk sbin statistics --calculate-all
-
Connect to your Plesk server via SSH.
-
Check if the
make
utility is installed on the server:# which make
If this command's output is empty, install the required package:
# apt-get install make
-
Install the GeoIP module:
# perl -MCPAN -e "install Geo::IP::PurePerl"
# perl -MCPAN -e "install Geo::IP"
-
Run these commands to uncomment the plugin in AWStats configuration files:
# /bin/sed -ire '/GeoIP.dat/ s/^#//' /etc/awstats/awstats.conf
# /bin/sed -ire '/GeoIP.dat/ s/^#//' /etc/awstats/awstats.model.conf
-
Run this command to uncomment the line for all existing domains which are using AWstats:
# for file in /usr/local/psa/etc/awstats/*; do /bin/sed -ire '/GeoIP.dat/ s/^#//' "$file"; echo "$file is updated"; done
-
Recalculate web statistics for all existing domains:
# plesk sbin statistics --generate-all-webstat
# plesk sbin statistics --calculate-all
Comments
1 comment
Hi Nikita Zubovich,
Can you please adjust the instructions, for achieveing the GEOIP on AWStats, when the GEOIP databas exists on the server, on *.dat or *.mmdb filetypes?
Such an adjustment, may relay on:
https://www.prosoxi.com/2009/01/27/geoip-filter-awstat-plesk/
If you want to use AWStats in applicable extent, you have to copy the javascript to every site on your server and include the following line into your index:
You can find the javascript here: /home/admispconfig/ispconfig/tools/awstats-6.5/wwwroot/js
Run the AWStats-script to create the statistic-files
First install the software :
Please sign in to leave a comment.