Mysql – Installing phpMyAdmin onto Amazon EC2 instance


I've configured my EC2 instance as a LAMP, following Amazon's tutorial. That appears to be functioning correctly (I can see phpinfo() in a file I've uploaded OK).

I then tried to install phpMyAdmin by doing the following:

sudo yum --enablerepo=epel install phpmyadmin

I can see that phpMyAdmin is now in /usr/share/phpmyadmin, so I added an symbolic link:

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

I then edited http.conf to add AllowOverride all to <Directory "/var/www/html">. (Command: sudo nano /etc/httpd/conf/httpd.conf)

And then restarted the server:

sudo service httpd restart

But whenever I visit I get a 403 Forbidden response from the server: You don't have permission to access /phpmyadmin on this server.

I feel like I'm missing something really obvious, but I cannot figure out what.

Best Solution

I needed to update the /etc/httpd/conf.d/phpMyAdmin.conf to allow remote users.

I just replaced the contents of the first <directory> tag like so...

I removed:

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

 <IfModule mod_authz_core.c>
  # Apache 2.4
    Require ip
    Require ip ::1
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from
  Allow from ::1

And replaced it with this:

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

 Order allow,deny
 Allow from all

And restarted the server: sudo service httpd restart

Works now!