Force Secure phpMyAdmin with HTTPS
When setting up cloudinclude.com we obviously needed a quick and easy way to work with the database, but not have to open up the unencrypted ports to access MySQL. While it is super easy to install phpMyAdmin for web-based database management on Ubuntu by sudo apt-get install phpmyadmin the default install lets you login over http sending your username and password in the clear.
We work fast and late on cloudinclude.com trying to make a great web based application for easy content management and surely one of us will login eventually over http without SSL protection.
Fortunatly it is quick and easy to force phpMyAdmin to use SSL and will redirect to the https protocol even if they go to http. Simply add this line to your phpMyAdmin config.inc.php.
$cfg['ForceSSL'] = TRUE;
Do bear in mind that you already have to have an SSL cert in place and setup. They are available for as little as $9.00. If you don't want to pay and you are using it purely on the backend you can look into generating a self-signed cert for free and ignore the browser warning. You will still get encryption, but you loose the third-party verification that you really are connecting to the server you intend to connect to which is what paying gets you.
Hope this helps someone and remember to check out cloudinclude.com to work in some CMS magic into your existing website in minutes!