Installing phpMyAdmin onto Amazon EC2 instance

前端 未结 3 980
难免孤独
难免孤独 2020-12-19 04:06

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

相关标签:
3条回答
  • 2020-12-19 04:38

    I replace

    <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>
    
    <Directory /usr/share/phpMyAdmin/setup/>
      Order Deny,Allow
      Deny from All
      Allow from 127.0.0.1
      Allow from ::1
    </Directory>
    

    to

    <Directory /usr/share/phpMyAdmin/>
       AddDefaultCharset UTF-8
    
       <IfModule mod_authz_core.c>
         # Apache 2.4
         <RequireAll>
           Require all granted
         </RequireAll>
       </IfModule>
       <IfModule !mod_authz_core.c>
         # Apache 2.2
         Order Allow,Deny
         Allow from All
       </IfModule>
    </Directory>
    
    <Directory /usr/share/phpMyAdmin/setup/>
       Order Allow,Deny
       Allow from All
    </Directory>
    

    And it works~

    0 讨论(0)
  • 2020-12-19 04:41

    I had the same issue, and Chuck Le Butt's solution was very helpful, although a little different for me...

    My ISP uses dynamic IP addresses so when I setup the server it was via a different IP. When I returned to it the following day, my IP address had changed so I was forbidden. Butt, rather than allowing access from all IP's as Chuck suggested, I've updated my previous IP addresses in the phpMyAdmin.conf file.

    sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
    
    0 讨论(0)
  • 2020-12-19 04:52

    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!

    0 讨论(0)
提交回复
热议问题