We have been using HiStats as a hit counter for years. We recently forced HTTPS on the site due to Chrome's upcoming decision to display HTTP as insecure. HiStats is causing a Mixed Content warning.
We would like to host the hit counter locally. We have found quite a few PHP based suggestions using text files on the server, and text in the browser/on the client. We'd like something a tad bit more professional.
Our requirements are:
- CentOS 7, Apache 2.4.6, PHP 5.4.16, MySLQ 15.1
- Mildly inaccurate is OK
- Database OK but not preferred
- Free/Open Source preferred
- Image to display count
- Image format JPG, JPEG, PNG or GIF
"Mildly inaccurate" means the server can keep a running total of visitors, keep it persisted on the filesystem for reboots, but regenerate the image representing the count every 5 minutes or so.
We are averse to risk and we run ModScurity in a fairly clamped down configuration. The site's owner is
root:apache, and its permissions are
0640. So please be careful about assumptions on PHP's ability to carry out tasks.
We were thinking something like a Cron Job or Task that runs ever 5 minutes, inspects Apache
access_logs logs for visitor count deltas, writes out a new count to the filesystem, generates the image and drops it in the website to be served.
RPM on Linux due to CentOS is fine, and build from sources is fine too. I prefer Free/Open Source, but I'm not over the top with the requirement like some GNU-ites.
Which packages or projects fit our needs?