CentOS phpmyadmin-Ordner verboten

CentOS phpmyadmin-Ordner verboten

installiert php5,apache2,LAMP, PHPMyAdmin aber wenn ich meine IP und PHPMyAdmin wie folgt eingebehttp://__meine_IP__/phpmyadmines zeigt den Fehler

Verboten.
Sie haben keine Berechtigung, auf diesem Server auf /PHPMyAdmin/ zuzugreifen.

Ich habe bearbeitet/etc/httpd/conf.d/phpmyadmin.confdiese Datei hat auch meine IP-Adresse hinzugefügt und meine IP-Adresse zugelassen, trotzdem wird der obige Fehler angezeigt,

meine phpmyadmin.conf-Datei sieht jetzt so aus

# 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

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

<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 27.34.248.3
#Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow

Wie kann ich auf den PHPMyAdmin-Ordner zugreifen, damit ich die Datenbank einfach verwalten kann? Ich verwende Redhat Linux 7.3, alle Pakete sind aktualisiert!

Bitte hilf mir!

Antwort1

Das funktioniert. Centos 7.

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

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Allow from All
   </IfModule>
</Directory>

Antwort2

Versuchen Sie diese Konfiguration:

  <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
   Require ip 27.34.248.3
   </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
   Allow from 27.34.248.3
  </IfModule>
  </Directory>

Starten Sie den Apache-Dienst neu:

systemctl restart httpd

Antwort3

Sie müssen in der Apache-Konfigurationsdatei von phpmyadmin ändern

Der Speicherort ist /etc/httpd/conf.d/phpMyAdmin.conf.

Die Standardkonfiguration lautet:

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

Ändern Sie es in:

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

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Allow from All
   </IfModule>
</Directory>

und starten Sie Apache mit dem Befehl neu

# service httpd restart

ODER

# systemctl restart  httpd.service

verwandte Informationen