Forums

Resolved
0 votes
Back many moons ago Clarkconnect, the forerunner of ClearOS, incorporated AWStats. Loved it for its webserver statistics reports. Still use it in fact. So if you want to give it a whirl, read on...

Well, in fact, the instructions are a bit long - some 475 lines (now 603 with the updated additions from the appends re. Country and City). It combines details for both current ClearOS versions, so because of its size am a bit reluctant to post here. Don't be put off by the length - it's relatively simple to do. Explained Step by Step The awstats rpm is installed from epel for both versions. The only 'work' is to setup some configuration files so it works under ClearOS.

For security, access to AWStats, once installed using these instructions, is only available using https: and a userid/password pair...

So if you are interested go to http://www.sraellis.tk/master.php?topic=install_awstats

Demo here :- http://www.nltechno.com/awstats/awstats.pl?config=destailleur.fr
AWSats Home :- http://www.awstats.org/
Monday, February 20 2017, 03:49 AM
Share this post:
Responses (2)
  • Accepted Answer

    Tuesday, February 21 2017, 01:31 AM - #Permalink
    Resolved
    0 votes
    For AWStats to show the individual cities in "Countries - Cities" create the following script and run it. Beware of the long middle line (unwrap if necessary) and don't forget to make executable, called mine GeoCity.sh, so....
    # chmod 755 GeoCity.sh

    #!/bin/bash

    wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -O /usr/share/GeoIP/GeoLiteCity.dat.gz && gunzip --force usr/share/GeoIP/GeoLiteCity.dat.gz

    ln -s /usr/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat

    Now edit your conf files in /etc/awstats.
    Look for '#LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat" ' about line 14xx and add a line below as in this snippet...

    ... snipped
    # PLUGIN: GeoIP_City_Maxmind
    # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
    # PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPCity.dat[+/pathto/override.txt]]
    # DESCRIPTION: This plugin adds a column under the hosts field and tracks the pageviews
    # and hits by city including regions.
    # Replace spaces in the path of geoip data file with string "%20".
    #
    #LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat"
    LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPCity.dat" # <-- new line

    # PLUGIN: GeoIP_ASN_Maxmind
    # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
    # PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPASN.dat[+/pathto/override.txt][+http://linktoASlookup]]
    ... snipped

    Goto directory /var/lib/awstats/ and delete all the .txt files there
    # cd /var/lib/awstats/
    # rm *.txt
    run the following command to re-create your data with the country information *note this is all one long line...

    /usr/share/awstats/tools/awstats_updateall.pl now -confdir="/etc" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"

    You should now see the cities from which your visitors accessed your web-site... (refresh your browser if they don't appear).

    To make life easier the following files can be downloaded
    for ClearOS 6.x

    http://www.sraellis.tk/awstats6/GeoCity.sh
    http://www.sraellis.tk/awstats6/awstats.conf

    For ClearOS7.x just change the 6 in the above urls to a 7
    The reply is currently minimized Show
  • Accepted Answer

    Monday, February 20 2017, 04:08 PM - #Permalink
    Resolved
    0 votes
    For AWStats to show the individual countries in the "Countries - Full List" two rpms are required, namely GeoIP and perl-Geo-IP. To check
    # rpm -q GeoIP perl-Geo-IP
    if not installed
    # yum install GeoIP perl-Geo-IP

    Now edit your conf files in /etc/awstats.
    Look for "#LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"" about line 14xx and add a line below as in this snippet...

    ... snipped
    # PLUGIN: GeoIP
    # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
    # PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/geoip.dat[+/pathto/override.txt]]
    # DESCRIPTION: Builds a country chart and adds an entry to the hosts
    # table with country name
    # Replace spaces in the path of geoip data file with string "%20".
    #
    #LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"
    LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat" # <---- added line

    # PLUGIN: GeoIP6
    # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind, version >= 1.40)
    #LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"
    ... snipped

    For ClearOS 7.x
    Goto directory /var/lib/awstats/ and delete all the .txt files there
    # cd /var/lib/awstats/
    # rm *.txt

    For ClearOS 6.x delete the newest .txt file in /var/www/awstats/

    run the following command to re-create your data with the country information *note this is all one long line...

    /usr/share/awstats/tools/awstats_updateall.pl now -confdir="/etc" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl

    You should now see country information for your visitors along with their country flag.

    Good Luck.
    The reply is currently minimized Show
Your Reply