[box ] Here we are performing phpmyadmin host on Amzaon EC2 instance , it is very simple like the other Linux box configuration .We can install and configure phpMyAdmin through download package and install it or install through yum global repositories. Here i have used remi repository for installing phpmyadmin package.If you want to install Remi, repository on your CentOS / RHEL / Fedora Box , you can check our article Configure Additional YUM Repositories for CentOs , Red Hat and Fedora
Here I am following install through yum repository.
- Install phpmyadmin rpm package through yum command by enabling remi repositories .
Steps to install phpmyadmin which I have followed
#yum --enablerepo=remi install phpMyAdmin
Resolving Dependencies --> Running transaction check ---> Package phpmyadmin.noarch 0:220.127.116.11-2.el6.rf will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: phpmyadmin noarch 18.104.22.168-2.el6.rf rpmforge 2.7 M Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 2.7 M Installed size: 13 M Is this ok [y/N]:
2. Now navigate to the configuration file “/etc/httpd/conf.d/phpMyAdmin.conf” and allow to open phpmyadmin to access outside the local environment. Do the entry like below to phpMyadmin allow to outside your local system.
Comment the line of IP , which have loop back address and insert your IP with required parameter like below .
<Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 Require local </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All # Replace here with your IP or Network.I have replace with 172.24.254.0/24 Allow from 172.24.254.0/24 Allow from ::1 </IfModule> </Directory>
(3) For MySQL configuration in phpMyAdmin
We have a RDS instance for Database , So we need to modify mysql host in config.inc.php file , which will in /usr/share/phpmyadmin folder , if it will not available with that name , might be it will named as config.sample.inc.php then we need to create config.inc.php file and copy of content of sample file into it.
vim /etc/phpMyAdmin/config.inc.php From $cfg['Servers'][$i]['host'] = 'localhost'; To $cfg['Servers'][$i]['host'] = 'xxxxxxxxxxx.rds.amazonaws.com'; //Your-RDS-Instance-Endpoint
4. Now restart your apache web server .
# service httpd restart or #/etc/init.d/httpd restart
5. Now access your phpMyAdmin through elastic IP of your Amazon EC2 instance like below.
You can read more article to install and secure phpmyadmin on below links.
That’s it! at this moment ..