1

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
  • JavaScript OK but not preferred
  • 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?

  • 1
    Mentioning Cron and Posix permissions: Is the assumption correct you need this to run on Linux (just in case there might be a stand-alone solution not using PHP, which probably would be the best approach)? What flavor (in case of RPM/DEB/… packages being available)? Any budget (in case of paid software)? – Izzy Nov 8 '16 at 10:47
  • 1
    @Izzy - 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. We are a FOSS project, too. If you visit the site, you can see the mixed content wart. – jww Nov 8 '16 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.