Use The Webalizer to Analyze Apache Web Logs
The Webalizer is a free, open source application for analyzing Apache log files. It provides highly detailed and configurable web usage reports in an HTML format which you can view in a browser. Learn how to install The Webalizer on a Cloud Server, and configure the server to automatically run this application at regular intervals in order to update the statistics.
Requirements
- A Cloud Server with Linux (CentOS 7)
- Apache installed and running
- KVM based dev servers for developers
- Scalable to enterprise cloud level
- Pay-as-you-go, per-minute billing
Apache is installed and running on a standard Linux installation by default. If your server was created with a minimum installation, you will need to install and configure Apache before you proceed.
Use Webalizer under CentOS 7
Update the server’s installed packages:
sudo yum updatebashInstall The Webalizer:
sudo yum install webalizerbashRun The Webalizer to analyze the existing Apache log files:
sudo webalizerbashBy default, the report for the server’s primary domain will be saved to /var/www/usage. The Webalizer package already creates an alias /usage for it, but only allows access from the server itself. In order to be able to view this in a browser, open The Webalizer’s Apache configuration file for editing:
sudo nano /etc/httpd/conf.d/webalizer.confbashIn the <Location /usage> block, replace the line Require local with Require all granted so that the report can also be reached from outside (alternatively, use Require ip to allow only specific IP addresses or networks). The section then looks like this:
Alias "/usage" "/var/www/usage"
<Location /usage>
Require all granted
</Location>apacheconfSave and exit the file. Then restart Apache for the changes to take effect:
sudo systemctl restart httpdbashYou will now be able to view The Webalizer reports at http://example.com/usage.
Add The Webalizer to Cron
Cron is a Linux utility which runs commands at the specified intervals. Open the crontab file for editing:
sudo crontab -ebashAdd the following line to this file to run the webalizer command once an hour:
0 * * * * /usr/bin/webalizertextSave and exit the file.


