I have been testing the Mint PHP web statistics script for my development sites lately, and though I love it and the modular plugins you can get for it, one feature is sorely lacking – multiple user logins.
This quick hack is by no means revolutionary, but it certainly does get the job done.
A new feature in Mint 1.2.x is to allow what’s called a “client mode” where anyone can access the statistics without the need to login. While this works for locally hosted Mint installations, the is definitely sub-optimal when it comes to a production site.
The solution? I’m sure you may have guessed it already, but by using .htaccess, you can easily set up multiple logins to Mint!
In my case I use subdomains like minttea.mytestsite.com. Using SSH, I logon to minttea.mytestsite.com, and issue this command:
In order to add user to the file, you must append the .htaccess file with lines similar to this htaccess guide.
You’ll need to encrypt the usernames and passwords, but once it’s done you will have logins enabled.
Please note that this method is susceptible to a brute-force attack, but it will keep most people from poking around with your stats.
Once I have figured out a better way (using PHP for example) I will post it here too.