Install PHPmyadmin on Centos 6.4 5.9 Redhat RHEL Fedora 19

Install PHPmyadmin on Centos 6.4 5.9 Redhat RHEL Fedora 19

phpmyadmin

PHPmyadmin: is used to manage mysql by HTTP protocol.

Step 1: Install Epel repository on your CentOS, Redhat RHEL (Fedora we don’t need do this step)

http://ithelpblog.com/os/linux/redhat/centos-redhat/how-to-install-epel-repository-on-centos-6-4-or-redhat-6-4-rhel/

Step 2: Install phpmyadmin by yum

[root@localhost ~]# yum install phpmyadmin
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink | 5.3 kB 00:00
* base: centos-hcm.viettelidc.com.vn
* epel: mirror.neu.edu.cn
* extras: centos-hcm.viettelidc.com.vn
* updates: centos-hcm.viettelidc.com.vn
adobe-linux-x86_64 | 951 B 00:00
base | 3.7 kB 00:00
chrome | 951 B 00:00
epel | 4.2 kB 00:00
epel/primary_db | 5.5 MB 02:28
extras | 3.4 kB 00:00
google-chrome | 951 B 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.4 MB 00:21
virtualbox | 951 B 00:00
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package phpMyAdmin.noarch 0:3.5.8.1-1.el6 will be installed
–> Processing Dependency: php-mcrypt >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-gd >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-php-gettext for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Running transaction check
—> Package php.x86_64 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-5.3.3-23.el6_4.x86_64
–> Processing Dependency: php-cli(x86-64) = 5.3.3-23.el6_4 for package: php-5.3.3-23.el6_4.x86_64
—> Package php-gd.x86_64 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-5.3.3-23.el6_4.x86_64
—> Package php-mcrypt.x86_64 0:5.3.3-1.el6 will be installed
–> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.3.3-1.el6.x86_64
—> Package php-php-gettext.noarch 0:1.0.11-3.el6 will be installed
–> Running transaction check
—> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
—> Package libmcrypt.x86_64 0:2.5.8-9.el6 will be installed
—> Package php-cli.x86_64 0:5.3.3-23.el6_4 will be installed
—> Package php-common.x86_64 0:5.3.3-22.el6 will be updated
–> Processing Dependency: php-common(x86-64) = 5.3.3-22.el6 for package: php-mysql-5.3.3-22.el6.x86_64
–> Processing Dependency: php-common(x86-64) = 5.3.3-22.el6 for package: php-mbstring-5.3.3-22.el6.x86_64
–> Processing Dependency: php-common(x86-64) = 5.3.3-22.el6 for package: php-pdo-5.3.3-22.el6.x86_64
—> Package php-common.x86_64 0:5.3.3-23.el6_4 will be an update
–> Running transaction check
—> Package php-mbstring.x86_64 0:5.3.3-22.el6 will be updated
—> Package php-mbstring.x86_64 0:5.3.3-23.el6_4 will be an update
—> Package php-mysql.x86_64 0:5.3.3-22.el6 will be updated
—> Package php-mysql.x86_64 0:5.3.3-23.el6_4 will be an update
—> Package php-pdo.x86_64 0:5.3.3-22.el6 will be updated
—> Package php-pdo.x86_64 0:5.3.3-23.el6_4 will be an update
–> Finished Dependency ResolutionDependencies Resolved=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
phpMyAdmin noarch 3.5.8.1-1.el6 epel 4.3 M
Installing for dependencies:
libXpm x86_64 3.5.10-2.el6 base 51 k
libmcrypt x86_64 2.5.8-9.el6 epel 96 k
php x86_64 5.3.3-23.el6_4 updates 1.1 M
php-cli x86_64 5.3.3-23.el6_4 updates 2.2 M
php-gd x86_64 5.3.3-23.el6_4 updates 106 k
php-mcrypt x86_64 5.3.3-1.el6 epel 18 k
php-php-gettext noarch 1.0.11-3.el6 epel 21 k
Updating for dependencies:
php-common x86_64 5.3.3-23.el6_4 updates 524 k
php-mbstring x86_64 5.3.3-23.el6_4 updates 455 k
php-mysql x86_64 5.3.3-23.el6_4 updates 81 k
php-pdo x86_64 5.3.3-23.el6_4 updates 75 kTransaction Summary
=====================================================================================================================================================================================================
Install 8 Package(s)
Upgrade 4 Package(s)Total download size: 9.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/12): libXpm-3.5.10-2.el6.x86_64.rpm | 51 kB 00:00
(2/12): libmcrypt-2.5.8-9.el6.x86_64.rpm | 96 kB 00:07
(3/12): php-5.3.3-23.el6_4.x86_64.rpm | 1.1 MB 00:04
(4/12): php-cli-5.3.3-23.el6_4.x86_64.rpm | 2.2 MB 00:09
(5/12): php-common-5.3.3-23.el6_4.x86_64.rpm | 524 kB 00:02
(6/12): php-gd-5.3.3-23.el6_4.x86_64.rpm | 106 kB 00:00
(7/12): php-mbstring-5.3.3-23.el6_4.x86_64.rpm | 455 kB 00:02
(8/12): php-mcrypt-5.3.3-1.el6.x86_64.rpm | 18 kB 00:01
(9/12): php-mysql-5.3.3-23.el6_4.x86_64.rpm | 81 kB 00:00
(10/12): php-pdo-5.3.3-23.el6_4.x86_64.rpm | 75 kB 00:00
(11/12): php-php-gettext-1.0.11-3.el6.noarch.rpm | 21 kB 00:01
(12/12): phpMyAdmin-3.5.8.1-1.el6.noarch.rpm | 4.3 MB 03:49
—————————————————————————————————————————————————————————————————–
Total 35 kB/s | 9.0 MB 04:25
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : php-common-5.3.3-23.el6_4.x86_64 1/16
Updating : php-mbstring-5.3.3-23.el6_4.x86_64 2/16
Installing : php-php-gettext-1.0.11-3.el6.noarch 3/16
Installing : php-cli-5.3.3-23.el6_4.x86_64 4/16
Installing : php-5.3.3-23.el6_4.x86_64 5/16
Updating : php-pdo-5.3.3-23.el6_4.x86_64 6/16
Updating : php-mysql-5.3.3-23.el6_4.x86_64 7/16
Installing : libmcrypt-2.5.8-9.el6.x86_64 8/16
Installing : php-mcrypt-5.3.3-1.el6.x86_64 9/16
Installing : libXpm-3.5.10-2.el6.x86_64 10/16
Installing : php-gd-5.3.3-23.el6_4.x86_64 11/16
Installing : phpMyAdmin-3.5.8.1-1.el6.noarch 12/16
Cleanup : php-mysql-5.3.3-22.el6.x86_64 13/16
Cleanup : php-pdo-5.3.3-22.el6.x86_64 14/16
Cleanup : php-mbstring-5.3.3-22.el6.x86_64 15/16
Cleanup : php-common-5.3.3-22.el6.x86_64 16/16
Verifying : php-cli-5.3.3-23.el6_4.x86_64 1/16
Verifying : php-common-5.3.3-23.el6_4.x86_64 2/16
Verifying : php-php-gettext-1.0.11-3.el6.noarch 3/16
Verifying : php-pdo-5.3.3-23.el6_4.x86_64 4/16
Verifying : libXpm-3.5.10-2.el6.x86_64 5/16
Verifying : php-5.3.3-23.el6_4.x86_64 6/16
Verifying : php-mcrypt-5.3.3-1.el6.x86_64 7/16
Verifying : phpMyAdmin-3.5.8.1-1.el6.noarch 8/16
Verifying : php-mysql-5.3.3-23.el6_4.x86_64 9/16
Verifying : php-mbstring-5.3.3-23.el6_4.x86_64 10/16
Verifying : libmcrypt-2.5.8-9.el6.x86_64 11/16
Verifying : php-gd-5.3.3-23.el6_4.x86_64 12/16
Verifying : php-common-5.3.3-22.el6.x86_64 13/16
Verifying : php-mysql-5.3.3-22.el6.x86_64 14/16
Verifying : php-mbstring-5.3.3-22.el6.x86_64 15/16
Verifying : php-pdo-5.3.3-22.el6.x86_64 16/16

Installed:
phpMyAdmin.noarch 0:3.5.8.1-1.el6

Dependency Installed:
libXpm.x86_64 0:3.5.10-2.el6 libmcrypt.x86_64 0:2.5.8-9.el6 php.x86_64 0:5.3.3-23.el6_4 php-cli.x86_64 0:5.3.3-23.el6_4 php-gd.x86_64 0:5.3.3-23.el6_4 php-mcrypt.x86_64 0:5.3.3-1.el6
php-php-gettext.noarch 0:1.0.11-3.el6

Dependency Updated:
php-common.x86_64 0:5.3.3-23.el6_4 php-mbstring.x86_64 0:5.3.3-23.el6_4 php-mysql.x86_64 0:5.3.3-23.el6_4 php-pdo.x86_64 0:5.3.3-23.el6_4

Complete!
[root@localhost ~]#

 

Step 3: Allow access from your network to PHPmyadmin

[root@localhost conf.d]# cd /etc/httpd/conf.d
[root@localhost conf.d]#[root@localhost conf.d]# vi phpMyAdmin.conf
# phpMyAdmin – Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSLAlias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin<Directory /usr/share/phpMyAdmin/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from 192.168.
Allow from ::1
</IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from 192.168.
Allow from ::1
</IfModule>
</Directory>

# These directories do not require access over HTTP – taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#<IfModule mod_security.c>
# <Directory /usr/share/phpMyAdmin/>
# SecRuleInheritance Off
# </Directory>
#</IfModule>

Step 4: Restart http service

[root@localhost ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
[root@localhost ~]#

Step 5: Allow PHPmyadmin via Firewall

iptables -I INPUT 1 -p tcp -m tcp –dport 80 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT 1 -p tcp -m tcp –dport 443 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT 1 -m state –state RELATED,ESTABLISHED -j ACCEPT

Step 6: Access phpmyadmin by web interface

http://x.x.x.x/phpmyadmin

That’s done. Thanks for using IThelpblog.com.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>