Setting up phpMyAdmin on CentOS 6

Here's how to get phpMyAdmin, the MySQL GUI, working under CentOS 6:

Step 1: Turn on EPEL repository

phpMyAdmin is not included in default RHEL / CentOS repo. So turn on EPEL repo like this:
$ cd /tmp$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm# rpm -ivh epel-release-6-8.noarch.rpm

Step 2: Install phpMyAdmin on a CentOS / RHEL Linux

Type the following yum command to download and install phpMyAdmin:
# yum search phpmyadmin# yum -y install phpmyadmin


Step 3: Fix phpMyAdmin permission

WARNING! What I'm about to show you is very dangerous, unless you are accessing phpMyAdmin using an ssh tunnel*

As root, edit:
/etc/httpd/conf.d/phpmyadmin.conf
Comment out lines that look like this:

#Order Allow,Deny #Deny from all Allow from 127.0.0.1

Restart apache with:

# service httpd restart

*To make using an ssh tunnel easier, edit your ~/.ssh/config file like this:

Host <anyNameYouLike>    HostName ec2-x-x-x-x.compute-1.amazonaws.com     User <username>    LocalForward 8080 ec2-x-x-x-x.compute-1.amazonaws.com:8080    LocalForward 8088 ec2-x-x-x-x.compute-1.amazonaws.com:80


After you save the changes to the config file, you can now setup the tunnel to forward local ports to your MySQL server with:

ssh <anyNameYouLike>

Then just go to "http://localhost:8088/phpMyAdmin". If you are not asked for a user name and password, refer the the above permission changes.

Comments

Popular posts from this blog

Authentication for RESTful APIs

Security From Happiness

Actually Getting to Least Privilege in AWS Lambda