Combustible Systems

A hobby sysadmin blog

mySQL administration with phpmyadmin from localhost only

First, install phpmyadmin. Make sure to check the apache2 option during installation. I entered the root password and let it generate it's own password for communicating with the database.

sudo apt-get install phpmyadmin

After installation, it looks like I can get to /phpmyadmin from any host. I just want it to be accessible from the local machine, for security reasons.

Edit the file /etc/phpmyadmin/apache.conf and add these lines to the /usr/share/phpmyadmin directory:

Order Deny,Allow
Deny from All
Allow from 127.0.0.1

I also got a warning from phpmyadmin about mcrypt not being active. If you have this problem, this page was helpful for me.

In summary, this fixes it:

sudo mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
sudo service apache2 restart

Comments