- AWStats uses the geoip country plugin for country detection from IP address location, and to populate the geographical traffic statistics. When this plugin is not installed in Plesk AWStats, you won't be able to check the geographical traffic statistics. In this article, we'll show you the steps to install the geoip country plugin in Plesk AWStats.
- AWStats is a free and very powerful tool that creating statics by analyzing Apache log files, ftp or mail servers. AWStats log analyzer works on CGI or command line interface and generate graphical statics from log files. This tutorial will help you to install AWStats Apache Log Analyzer on Ubuntu, Debian and LinuxMint systems.
- For some reason, AwStats showing some IPs with unknown status. However, to get this fix, you may apply GeoIP plugin to your AwStats statistic. Install Perl module. Open your Perl Package Manager which is stand for ppm.bat in bin folder. Install Geo-IP-PurePerl and Geo-IPfree module.
Since AWStats is a web server log file analyzer, the first prerequisite is a fully functional web server. In our case, it is Apache 2.4 on a FreeBSD 10 Server. Additionally, the web server should have the cgi_module loaded. Also, if geographical data is desired, then the additional port – p5-geo-ip is required.
Install AWStats:
Create A Certificate. OpenSSL should be installed on the server as this will be used to create the keys. Install on a CentOS or RHEL5 server. Move into the /etc/pki/tls/certs/ directory: yum install modssl. Create a RSA private key for the server: # openssl genrsa -des3 -out server.key 1024. Generating RSA private key, 1024 bit long modulus.
Install p5-Geo-IP:
Configure Apache httpd.conf:
Uncomment the following to load the cgi module:
Uncomment the following to use combined log file format:
Comment the following to not use the common log file format:
Add the following to the bottom of /usr/local/etc/apache24/httpd.conf:
Configure Apache httpd-ssl.conf:
If using SSL, ensure the CustomLog Combined Format is utilized. Change the following line in /usr/local/etc/apache24/extra/httpd-ssl.conf file.
Download GeoIP.dat.gz & GeoLiteCity.dat.gz:
Configure AWStats:
Create Configuration File for web site:
Edit awstats.www.loga.us.conf and change the following parameters:
Create data directory:
Process log files:
Geoip Service
Create Cron Job to process log files:
View the Results:
http://www.loga.us/awstats/awstats.pl —-Please substitue your own domain!
Log Notes:
Since the Apache Log Files are rotated using newsyslog.conf, I utilized the archived log file, httpd-access.log.1, when importing the data to AWStats. The Log Files in /var/log are as follows:
Updating GeoLite Databases:
Free Geoip Lookup Api
The port /net/GeoIP installed a file, geoipupdate.sh, located at /usr/local/bin/geoipupdate.sh to update the open source databases from www.maxmind.com. The script, if executed, will update the GeoIP.dat and GeoIPv6.dat automatically without additional configuration. In order to update the GeoLite City and the GeoLite ASN databases, you must enable them by setting GEOIP_FETCH_CITY and GEOIP_FETCH_ASN in your environment. Read the geoipupdate.sh for details.
Here are the setting in my configuration:
The script can be run manually to check if the files are downloaded properly. Once satisfied with the results, you can create a crontab entry to automate running the script on a schedule. MaxMind updates the open source databases on the second Tuesday of each month so schedule your crontab entry to reflect this information.
crontab -e:
This is my crontab entry:
Summary:
Installing and configuring AWStats was fairly easy once I familiarized myself with the configuration files and, of course, by trying different combinations until it was working as expected. This is a compilation of that effort.
References:
AWStats is short for Advanced Web Statistics it’s an powerful open source tool that generates advanced websites statistics, graphically and provides you with detailed statistics regarding visitors to your web site. AWStats suitable for analyzing data from Internet services such as web, streaming media, mail and FTP servers that shows you the statistics including visits, unique visitors, pages, hits, rush hours, os, browsers, search engines, keywords, robots visits, broken links and more.
1. Install Awstats using yum command :
Examples :
2. Assumed that the fqdn for the domain is centos63.ehowstuff.local. Copy the file from the awstats.model.conf:
3. Change the awstats configuration file for domain centos63.ehowstuff.local :
Modify at line 122 for log format :
Awstats Geoip Free Installation
Modify at line 153, set your hostname :
Modify at line 168, set the IP address to exclude from capturing :
4. Modify awstat main configuration file, awstats.conf :
Add Alias “Alias /report /var/www/awstats/” and “Allow 192.168.1.0/24” to access awstats :
5. Restart httpd :
6. Manually generate report :
7. Generate HTML from reports :
8. Change cron setting :
Make it comment
Add the following lines :
Free Geoip Database
Examples :
9. Monitor the awstats from the following URL :
http://server_IP_Address/report/index.html
The URL will produce something like this :
Maxmind Geoip Free
Related Posts
Geoip Demo
- How to Install Perl in CentOS 6.2When you try to install the rpm packages that was depend on the perl, you…
- How to Install Perl on CentOS 5.8Perl is an interpreted language that is very popular in the Unix community because it…
- How to Install Awstats on CentOS 5.5In this tutorial i will guide you on how to install AWStats in CentOS server.…
- How to Install vim on CentOS 6.2When i try to edit a file using vim instead of vi, the following error…
- How to Install and Configure Piwik on CentOS 6.2Piwik is an open source web analytics software that makes it easy to get the…