Search Suggest

How to install PhpMyAdmin package in CentOS/RHEL 6.X/7.X

This tutorial will guide you, How to install PhpMyAdmin package in CentOS/RHEL 6.X/7.X and  How to access MySQL database from GUI using PhpMyAdmin.  PhpMyAdmin package bydefault is not available in CentOS base repository. To install package you will require to install EPEL repository.

How to Enable EPEL Repository in CentOS/RHEL system

Install EPEL package on CentOS 6 64 bit
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

Install phpMyAdmin package
# yum install phpMyAdmin

Install Php package with php-mysql
# yum install php php-mysql

Check Apache service status, Install package if not installed
# service httpd status
httpd (pid  2149) is running...



URL to Access phpMyAdmin tool from browser
http://server-address/phpMyAdmin/
Login screen of phpMyAdmin




Successfully phpMyAdmin tool installed, you can now manage your database from GUI.


====================================================================================
If Found error:
Forbidden
You don't have permission to access /phpmyadmin/ on this server.


Check logs to diagnose the issue
#  tail -f /var/log/httpd/error_log
[Tue May 16 22:46:24 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue May 16 22:46:24 2017] [notice] Digest: generating secret for digest authentication ...
[Tue May 16 22:46:24 2017] [notice] Digest: done
[Tue May 16 22:46:24 2017] [notice] Apache/2.2.15 (Unix) DAV/2 configured -- resuming normal operations
[Tue May 16 22:47:07 2017] [error] [client 192.168.35.1] Directory index forbidden by Options directive: /var/www/html/
[Tue May 16 22:47:12 2017] [error] [client 192.168.35.1] File does not exist: /var/www/html/favicon.ico
[Tue May 16 22:47:29 2017] [error] [client 192.168.35.1] client denied by server configuration: /usr/share/phpMyAdmin/
[Tue May 16 22:47:35 2017] [error] [client 192.168.35.1] client denied by server configuration: /usr/share/phpMyAdmin

 Solution:
Go to PhpMyAdmin config file and change with below parameter.
#cp /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.org
#vim /etc/httpd/conf.d/phpMyAdmin.conf





<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1 192.168.35.144
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from  192.168.35.1
     Allow from ::1
   </IfModule>
</Directory>
 
Note: ip address 92.168.35.144 server interface ip and 192.168.35.1 is client ip address from where i am accessing url.

check log status again
[root@server ~]#  tail -f /var/log/httpd/error_log
[Tue May 16 23:07:16 2017] [notice] Digest: generating secret for digest authentication ...
[Tue May 16 23:07:16 2017] [notice] Digest: done
[Tue May 16 23:07:16 2017] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations



Đăng nhận xét