The Map Is Not The Territory: Why You Need AWStats
It is 2009, and everyone is obsessed with Google Analytics. It’s pretty, it’s free, and it generates colorful charts for the marketing team. But as any battle-scarred System Administrator knows, what the marketing dashboard shows and what is actually hitting your network interface are two very different realities.
I recently audited a high-traffic media portal hosted here in Oslo. Their analytics claimed 50,000 unique visitors. Their server load suggested double that. The culprit? The truth was in the logs. JavaScript-based trackers fail when users disable scripts, when mobile browsers (like on the new Nokia N97) choke on heavy JS, or when search spiders crawl your site.
To see the matrix, you need server-side analysis. You need AWStats.
The Architecture of Truth
AWStats (Advanced Web Statistics) parses your Apache or Nginx log files directly. It doesn't rely on the client browser triggering a script. If a request touches your server, AWStats captures it. This is critical for capacity planning—you cannot scale your RAM allocation based on "visits" that ignore 30% of your actual HTTP requests.
Step 1: Installation (CentOS 5 / RHEL)
Don't compile from source unless you enjoy pain. Use the EPEL repository.
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
# yum install awstats
Step 2: Configuration for High Accuracy
The default config is decent, but we need to tune it for the modern web. Edit /etc/awstats/awstats.yourdomain.conf. Make sure your LogFormat matches your Apache configuration.
If you are using the standard Apache 2.2 "Combined" format, ensure this line is set:
LogFormat=1
Pro Tip: DNS Lookups Kill Performance
By default, AWStats might try to reverse resolve IP addresses to hostnames. On a high-traffic server, this causes massive latency. SetDNSLookup=0in your config. Do the resolution offline or not at all. Your CPU will thank you.
The Hardware Bottleneck: I/O Wait
Here is the ugly truth about log analysis: It is a disk I/O killer.
Parsing a 2GB access log file requires reading huge blocks of data and writing statistical databases simultaneously. On a budget VPS oversold with hundreds of tenants on a single SATA drive, running AWStats can spike your Load Average to 5.0+, causing your web server to stutter.
This is where architecture matters. At CoolVDS, we don't gamble with shared I/O. Our nodes are built on Enterprise 15k RPM SAS drives in RAID-10. We use Xen virtualization, which isolates your disk throughput better than the "container" based hosting (like OpenVZ) many competitors use.
| Feature | Budget VPS (OpenVZ) | CoolVDS (Xen/RAID-10) |
|---|---|---|
| Disk I/O | Shared, easily choked by neighbors | Protected, high throughput SAS |
| Memory | Burstable (Unstable) | Dedicated RAM |
| Log Parsing Speed | Minutes to Hours | Seconds |
Data Sovereignty: The Norwegian Advantage
Privacy is becoming a headline issue. With the EU Data Protection Directive and Norway's strict Personopplysningsloven (Personal Data Act), sending user data to third-party US servers (like Google) is becoming legally complex.
When you use AWStats, the data never leaves your server. It sits safely in your /var/lib/awstats directory, right here in our Oslo datacenter. You own the data. Datatilsynet is happy. Your users are protected.
Automation
Finally, don't run this manually. Add a cron job to update your stats every hour.
# crontab -e
0 * * * * /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=yourdomain -update > /dev/null
If your current host chokes when you run a simple Perl script against your logs, it's time to upgrade. Real monitoring requires real hardware.
Need a server that can crunch numbers without slowing down your site? Deploy a Xen-based instance on CoolVDS today.