You are here

Installing phpMyAdmin on Webmin-Virtualmin

Webmin logo

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

  1. VPS with Webmin/Virtualmin installed (see this blog page)
  2. Putty or another SSH terminal program
  3. WinSCP or another SFTP program

1. Install PhpMyAdmin

Login with putty and enter:

apt-get install phpmyadmin

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).

php5enmod mcrypt

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

  1. Force phpmyadmin to use SSL only by in WinSCP opening /etc/phpmyadmin/ and adding at the bottom:
    $cfg['ForceSSL'] = true;{http to phpmyadmin should now NOT work}
  2. 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.

Webmin-Virtualmin How-To Blog Posts