Description
Setting up PHPMyAdmin on RHEL or Centos using the EPEL software repository
Requirements
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.conf
to 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)
1 2 3 4 5 6 7 8 9 10 |
<VirtualHost *:80> ServerAdmin admin@example.com DocumentRoot /var/www/html/phpadmin ServerName phpadmin.example.com ScriptAlias /cgi-bin/ /var/www/html/phpadmin/cgi-bin/ ## Enable if mod_security is installed ## # SecRuleInheritance Off ErrorLog logs/phpadmin.example.com_error_log CustomLog logs/phpadmin.example.com_access_log combined </VirtualHost> |
(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
C6: service httpd restart
C7: systemctl restart httpd.service
Troubleshooting
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
C6: service mysqld status; sudo service httpd status
C7: 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.
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