Setting up PHPMyAdmin on RHEL or Centos using the EPEL software repository
Explanation of requirements.
- Root or Sudo access with root privileges.
- Working httpd (Apache) configuration.
- Working MySQL or MariaDB configuration.
Doing the Work
Basic description of what will be done and what is expected.
- Setup EPEL:
- Install phpMyAdmin:
- Setup subdomain for your site to access phpMyAdmin:
- We’ll need to edit the httpd configuration or edit
/etc/httpd/conf.d/phpMyAdmin.confto add the subdomain in the virtual hosts section at the bottom as follows:
- Symlink the phpMyAdmin files to: /var/www/html/phpadmin or use /etc/httpd/conf.d/phpMyAdmin.conf
- Restart httpd
su -c "http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm"
sudo yum install phpMyAdmin
After the install, you can use: rpm -ql phpMyAdmin to see a list of files and their locations installed during the installation process.
For this example we’re going to create a virtual host subdomain as: phpadmin.example.com
We’re using “phpadmin instead of phpMyAdmin to make it easier to type, you can replace “phpadmin” with anything you like and add an SSL certificate for added security.
vi /etc/httpd/conf.d/vhosts.conf (this assumes you already have example.com setup and working)
ScriptAlias /cgi-bin/ /var/www/html/phpadmin/cgi-bin/
## Enable if mod_security is installed ##
# SecRuleInheritance Off
CustomLog logs/phpadmin.example.com_access_log combined
(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
service httpd restart
systemctl restart httpd.service
How to test
Explanation troubleshooting basics and expectations.
- Let’s go test and make sure we can login:
- Make sure httpd and (mysql | mysqld | mariadb) are started, also make sure you have a working MySQL or MariaDB configuration:
Open a web browser and navigate to: http://phpadmin.example.com
service mysqld status; sudo service httpd status
systemctl status mariadb.service; systemctl status httpd.service
Common problems and fixes
Common problems described here, include links to known common problems if located on another site.
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