How to install phpMyAdmin on Centos 6 Print

  • 0

Install phpMyAdmin

Now, we are ready to install the phpMyAdmin package. This software is not available in the CentOS 6 default repositories. However, it is available in the EPEL repos (Extra Packages for Enterprise Linux).

We can add access to the EPEL repositories to our system by typing:

  • sudo yum install epel-release

After accepting the new repository, you can install the phpMyAdmin package by typing:

  • sudo yum install phpmyadmin

This will install phpMyAdmin. We still must configure it though.

 

Step One — Configure phpMyAdmin

For security purposes, we should lock down access to the phpMyAdmin interface to a specific IP address.

Find Your IP Address

You will need to know the IP address of the computer you plan on using to access your databases. This is a security precaution so that unauthorized people cannot connect.

Note: This is the not the IP address of your VPS, it is the IP address of your home or work computer.

You can find out how the greater web sees your IP address by visiting one of these sites in your web browser:

Compare a few different sites and make sure they all give you the same value. Write this down.

Configure Apache Files

The phpMyAdmin package installs an Apache Virtual Host file that is used to configure web access. Open the file with the following command:

  • sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

By default, this configuration only allows access from the same computer that is hosting the software. Because the databases, web server, and administration software are hosted on a VPS instead of your home computer, we will have to adjust these values.

This is where the IP information about your home computer comes in handy. We will change every reference to 127.0.0.1 with the IP address you found.

There should be four locations that you need to change:

/etc/httpd/conf.d/phpMyAdmin.conf
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .

Save and close the file.

You need to restart the server with the following command:

  • sudo service httpd restart
 

Step Two — See the Results!

Your interface should now be configured and ready to access.

Point your web browser to your VPS IP address followed by "/phpmyadmin"

http://VPS_IP_address/phpmyadmin

You will be asked to log in. Use the user root and the password that you selected during the MySQL configuration


Was this answer helpful?

« Back