Install PhpMyAdmin on Amazon EC2 AMI

Most Linux distributions come with PhpMyAdmin preinstalled and ready to configure. However, this is not true of Red Hat distributions such as CentOS, Fedora, or Amazon AMI among others. For these distributions, phpMyAdmin is located in the Extra Packages for Enterprise Linux (or EPEL) repository. EPEL is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS, Scientific Linux (SL), and Oracle Linux (OL).

Installing PhpMyAdmin is not difficult and requires just a few minutes. These instructions apply to performing the installation from an OSX Yosemite machine.

Open Terminal from the Applications/Utilities folder

Open a New Remote Connection (⇧⌘K) and log into your AWS AMI instance and execute the following commands:

Execute commands on remote server

Shell

1

2

3

sudo yum update

sudo yum--enablerepo=epel install phpmyadmin

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

Edit /etc/httpd/conf.d/phpMyAdmin.conf to look like this:

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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

# 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 SSL

Alias/phpMyAdmin/usr/share/phpMyAdmin

Alias/phpmyadmin/usr/share/phpMyAdmin

Alias/mysqladmin/usr/share/phpmyadmin

<Directory/usr/share/phpMyAdmin/>

AddDefaultCharset UTF-8

Options All

AllowOverride All

Require all granted

<IfModule mod_authz_core.c>

# Apache 2.4

<RequireAny>

Require ip127.0.0.1

Require ip::1

</RequireAny>

</IfModule>

<IfModule!mod_authz_core.c>

# Apache 2.2

Order Deny,Allow

Deny from All

Allow from127.0.0.1

Allow from::1

</IfModule>

</Directory>

<Directory/usr/share/phpMyAdmin/setup/>

Options All

AllowOverride All

Require all granted

<IfModule mod_authz_core.c>

Edit the “blowfish secret" in /etc/phpMyAdmin/config.inc.php. Change string from default:

/etc/phpMyAdmin/config.inc.php

PHP

1

2

3

4

5

/*

* This is needed for cookie based authentication to encrypt password in

* cookie

*/

$cfg['blowfish_secret']='4875149021800013670';/* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Reader Interactions

The Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Comments

Jutst one question: I modified the /usr/share/phpMyAdmin but now get the message when I try to access the Web access (putting the public DNS of my AWS EC2 instance) that do not have the permissions: “You don’t have permission to access /phpMyAdmin/ on this server. apache port 80”

I’m not sure what you did. There are no instructions in the article for modifying the /usr/share/phpMyAdmin directory. I don’t use AWS any longer, but when I did, these are the instructions that allowed me to run phpMyAdmin. Sorry I can’t be more helpful this time.

We only use analytical cookies on our website that allow us to recognize and count the number of visitors and to see how visitors move around the site when they are using it, but they do not identify you individually. They help us to improve the way our website works, for example by ensuring that users are finding what they are looking for easily. Read more about the cookies we use by clicking the Cookie Policy button. By clicking OK you agree to cookies being used in accordance with our Cookie Policy. If you don’t agree you can disable cookies—see the Cookie Policy for more details.