On Sat, 27 Nov 2010 00:04:35 +0000 (GMT) Keith Roberts wrote:
Is this for one particular page, or every page on your site?
A small business owner that has a webpage on a Centos webserver that I look after asked me for a simple counter to count the number of hits that she gets on her webpage (index.html).
Awstats and similar log analyzers provide far more information than she cares about, understands or wants to see, and most of the hit counters that I can find on a google search either put the count on the same page that is being counted, or are trying to sell some kind of a third-party service.
I could probably write this thing myself if I have to but it seems so basic that I figure I would be reinventing the wheel. I could read access.log and count hits on a daily basis or something, but I'm not sure that I understand the log structure well enough to do it right. There are several files names index.html on that webserver and on a cursory examination it seems that a lot of the time the initial hit on a website is logged as "/".