nstalling phpMyAdmin in Amazon EC2 instance

0 votes

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 http://ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/phpmyadmin 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.

Jul 13, 2018 in AWS by Flying geek
• 3,280 points
1,613 views

1 answer to this question.

0 votes

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
  <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 ::1
 </IfModule>
</Directory>

And replaced it with this:

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

 Order allow,deny
 Allow from all
</Directory>

And restarted the server: sudo service httpd restart

Works now!

answered Jul 13, 2018 by Cloud gunner
• 4,670 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

Graphical User Interface in Amazon EC2 instance

I am not exactly sure if an AMI of ...READ MORE

answered May 13, 2019 in AWS by Archana
• 5,640 points
630 views
0 votes
1 answer

how to get aws account number /id based on EC2 instance which is hosted in amazon

You can obtain account number from an ...READ MORE

answered Feb 21, 2022 in AWS by Korak
• 5,820 points
1,722 views
0 votes
1 answer
0 votes
3 answers
+1 vote
2 answers

How do I run python script on aws EC2 instance(ubuntu)?

I believe that you are using the ...READ MORE

answered Apr 17, 2018 in AWS by Cloud gunner
• 4,670 points
9,924 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP