Virtualmin has a script for installing phpMyAdmin but this installs a copy for each site. For a small host where sites owner and host owner are one and the same I prefer one central copy of phpMyAdmin, accessed off the host hub domain rather than the virtual domains. This of course still accesses all databases.
0. Prerequisites
- VPS with Webmin/Virtualmin installed (see this blog page)
- Putty or another SSH terminal program
- WinSCP or another SFTP program
1. Install PhpMyAdmin
Login with putty and enter:
The install will present 4 screens:
- screen 1 - hit space to put * next to apache2 then tab to ok and hit enter.
- screen 2 - yes to dbconfig-common (hit enter).
- screen 3 - enter mysql root password you gave in section 5 when installing webmin/virtualmin.
- screen 4 - enter password for phpmyadmin's use, or leave it blank for an automatic password - don't use system root password.
In putty install php mcrpyt which phpmyadmin needs (and seems to fetch for you).
To make mcrypt active either reboot or in Servers->Apache Webserver click apply changes to restart Apache. Test that phpmyadmin is working by pointing a browser at http://new-ip-number/phpmyadmin.
2. Set-up PhpMyAdmin for https only
- Force phpmyadmin to use SSL only by in WinSCP opening /etc/phpmyadmin/config.inc.php and adding at the bottom:
$cfg['ForceSSL'] = true;{http to phpmyadmin should now NOT work}
- In putty add ssl to apache
cd /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/default-ssl.conf
Or if you prefer copy default-ssl.conf to /etc/apache2/sites-enabled so any changes don't change default-ssl.conf. We need to apply these changes so in a browser go to https://new-ip-number:10000 and login. Go to Servers->Apache Webserver and click apply changes. Test phpmyadmin works under httpS by pointing a brower to https://new-ip-number/phpmyadmin. The browser will complain about security because the certificates are self-signed. To fix this see the blog page on free SSL certificates.
Recent comments