Setting up PHPMyAdmin on Centos 5.x using the EPEL software repository

Applicable to Centos Versions:

  • Centos 5.x

Requirements

Explanation of requirements.

  1. Root or Sudo access with root privileges.
  2. Working httpd (Apache) configuration.
  3. Working MySQL configuration.
  4. Internet access.

Doing the Work

Basic description of what will be done and what is expected.

  1. Setup EPEL:
  2. su -c "http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm"
  3. Install phpMyAdmin:
  4. sudo yum install phpMyAdminAfter the install, you can use: rpm -ql phpMyAdminto see a list of files and their locations installed during the installation process.
  5. Setup subdomain for your site to access phpMyAdmin:
  6. For this example we're going to create a virtual host subdomain as: phpadmin.example.comWe're using "phpadmin instead of phpMyAdmin to make it that much harder to guess, you can replace "phpadmin" with anything you like and an ssl connection for added security.
    
    We'll need to edit the httpd configuration or edit /etc/httpd/conf.d/phpMyAdmin.conf to add the subdomain in the virtual hosts section at the bottom as follows:
    
    1. vi /etc/httpd/conf/httpd.conf (this assumes you already have example.com setup and working)
    
    <VirtualHost *:80> ServerAdmin admin@example.com DocumentRoot /var/www/html/phpadmin ServerName phpadmin.example.com ScriptAlias /cgi-bin/ /var/www/html/phpadmin/cgi-bin/ SecRuleInheritance Off ErrorLog logs/example.phpadmin_error_log CustomLog logs/example.phpadmin_access_log combined</VirtualHost>
    
    2. Symlink the phpMyAdmin files to: /var/www/html/phpadmin or use /etc/httpd/conf.d/phpMyAdmin.conf(note: make sure /var/www/html/phpadmin does not exist before running the symlink command)sudo ln -s /usr/share/phpMyAdmin /var/www/html/phpMyAdmin
    
    3. Restart httpd: sudo service httpd restart

Troubleshooting

How to test

Explanation troubleshooting basics and expectations.

  1. Let’s go test and make sure we can login:
  2. Open a web browser and navigate to: http://phpadmin.example.com
  3. Make sure httpd and mysqld are started, also make sure you have a working MySQL configuration:
  4. sudo service mysqld status; sudo service httpd status

Common problems and fixes

Common problems described here, include links to known common problems if located on another site.

More Information

Any additional information or notes.

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #centoshelp on irc.freenode.net

Added Reading

© 2012 CentosHelp.org