Install phpMyAdmin 4.2.7 on CentOS 7 / RHEL 7

ADVERTISEMENT

phpMyAdmin
phpMyaAdmin is the web based administration tool for managing the MySQL, MariaDB and Drizzle servers, it helps in performing databases activities such as creating, deleting ,querying , tables, columns, relations, indexes, users, permissions, etc. This guide will help you to install phpMyAdmin on CentOS 7 / RHEL 7.

Before installing phpMyAdmin, you must have LAMP installed on the server. Here is the tutorial on Installing LAMP on CentOS 7 / RHEL 7.

ADVERTISEMENT
Article will continue after the ad

Installing phpMyAdmin:

I am assuming that you have completed the previous step, phpMyAdmin is available in EPEL; so Install EPEL repository rpm.

# rpm -Uvh http://epel.mirror.net.in/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

Install phpMyAdmin using the following command.

# yum -y install phpmyadmin

Configuring phpMyAdmin:

By-default phpMyAdmin places the web config file in /etc/httpd/conf.d directory; it has the rules and access permission for the access. phpMyAdmin can be accessed only from the localhost, to change that; we have to edit the phpMyadmin.conf file. In CentOS 7, web access is managed by mod_authz_core.c module; so normal allow or deny rules wont work even if you modify.

vi /etc/httpd/conf.d/phpMyAdmin.conf

Default config will look like below.

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin



# Apache 2.4

Require ip 127.0.0.1
Require ip ::1



# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1





# Apache 2.4

Require ip 127.0.0.1
Require ip ::1



# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1

Please comment out Require ip 127.0.0.1 and Require ip ::1 then add Require all granted just below to commented line, it will look like below.

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
usr/share/phpMyAdmin/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
#Require ip 127.0.0.1
#Require ip ::1
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
#Require ip 127.0.0.1
#Require ip ::1
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
Restart the services.
systemctl reload httpd.service

Configure firewall to allow http request from the external network.

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --reload

Accessing phpMyAdmin:

Now access the phpPgAdmin from the browser, url will be http://your-ip-address/phpMyAdmin.
Login by using root or admin user.

Install phpMyAdmin 4.2.7 on CentOS 7  - phpMyadmin Login Page
Install phpMyAdmin 4.2.7 on CentOS 7 – phpMyadmin Login Page

You will get the database page.

CentOS 7 - phpMyadmin Home Page
CentOS 7 – phpMyadmin Home Page

That’s All. Hope this helped you, we welcome your comments.

ADVERTISEMENT

POSTS YOU MAY LIKE -:)

Share This Post

  • Bruno

    Tnksss

Shares