Simple tracking of apache traffic

Frosty555 used Ask the Experts™
I'm hosting my own website on a local server on my office, and I'm hoping to keep tabs on the bandwidth usage and hits that the website is getting. I'm not too concerned about analytics, I just want to monitor the activity so I can know if the website is getting more traffic than my ISP will allow or if I'm getting hammered by any automated bots or crawlers.

I'm imagining a service that runs on the linux machine that monitors / parses the apache access logs or something... but if I have to put code onto my web pages I can do that too.

I've looked into Google Analytics and while it looks great, it also is tremendously complicated and I don't need nearly that level of sophistication, I really just need to see hit-counts and a breakdown of what IP addresses queries what pages when and how often.

Is there any simple php/apache/js/something way of monitoring the traffic through my apache server, or for my website?

Bonus if it can integrate cleanly with Nagios (e.g. a nagios plugin for a service check that will tell me if I'm exceeding my expected traffic threshold).

Again, I'm looking for something simple to implement, not super-feature-filled.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you enable the status modules built into apache and restrict their usage to your internal office Ip's it can show you the amount of traffic in and out since the last apache reboot and number of requests, though this doesn't represent the number of hits.  On the other hand you can use something like awstats.  It does more than you need but it is easy enough to install.  It would install on the linux host and could automatically parse the logs daily.  
Linux Server Administrator
I would recommend you to use a stats program like AWStats or Webalizer. AWStats will give you the exact traffic usage. Also the reading will be more accurate because it reports from the server. Also its not that good to use Google analytics because Google analytics monitor the website from outside and not from the server. So its better to install AWStats.


Webalizer :


piwik looks really promising and easy to install, but requires a tracking script on every single page. Not impossible to do, but I really like the idea behind Webalizer that it reads the server logs directly.

The apache built in stats are a nice feature too - I didn't realize that Apache had already done that.

Thanks for the help guys, this is great start.


Solution is going to be one of: Webalizer, Piwik, or Apache mod_status

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial