usuario remoto remotas permitir otra desde crear conexiones conectar acceso acceder php mysql phpmyadmin mariadb

php - remotas - mysql remoto



phpMyAdmin permite usuarios remotos (7)

Necesito modificar el archivo /etc/httpd/conf.d/phpMyAdmin.conf para permitir que usuarios remotos (no solo localhost) inicien sesión

# 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/> <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/> <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> # These directories do not require access over HTTP - taken from the original # phpMyAdmin upstream tarball # <Directory /usr/share/phpMyAdmin/libraries/> Order Deny,Allow Deny from All Allow from None </Directory> <Directory /usr/share/phpMyAdmin/setup/lib/> Order Deny,Allow Deny from All Allow from None </Directory> <Directory /usr/share/phpMyAdmin/setup/frames/> Order Deny,Allow Deny from All Allow from None </Directory> # This configuration prevents mod_security at phpMyAdmin directories from # filtering SQL etc. This may break your mod_security implementation. # #<IfModule mod_security.c> # <Directory /usr/share/phpMyAdmin/> # SecRuleInheritance Off # </Directory> #</IfModule>


Las otras respuestas hasta ahora parecen abogar por el reemplazo completo del bloque <Directorio />, esto no es necesario y puede eliminar configuraciones adicionales como el ''AddDefaultCharset UTF-8'' ahora incluido.

Para permitir el acceso remoto, debe agregar 1 línea al bloque de configuración 2.4 o cambiar 2 líneas en el 2.2 (dependiendo de su versión de apache):

<Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> #ADD following line: Require all granted Require ip 127.0.0.1 Require ip ::1 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 #CHANGE following 2 lines: Order Allow,Deny Allow from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory>


Mi configuración fue un poco diferente usando XAMPP. en httpd-xampp.conf tuve que hacer el siguiente cambio.

Alias /phpmyadmin "C:/xampp/phpMyAdmin/" <Directory "C:/xampp/phpMyAdmin"> AllowOverride AuthConfig Require local ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

cambiar a

Alias /phpmyadmin "C:/xampp/phpMyAdmin/" <Directory "C:/xampp/phpMyAdmin"> AllowOverride AuthConfig #makes it so I can config the database from anywhere #change the line below Require all granted ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

Necesito decir que soy nuevo en esto, así que solo estoy hackeando, pero así es como funcionó.


Mi respuesta se basa en obtener un error 403 aunque tuve todas las configuraciones de Apache mencionadas en las otras respuestas correctas.

Era un servidor Centos 7 nuevo y resultó que el problema no era la configuración de Apache sino el hecho de que el PhpMyAdmin no servía en absoluto. La solución fue instalar php y agregar la directiva php a apache.conf:

  • sudo yum instalar php php-mysql
  • vim /etc/httpd/conf/httpd.conf agrega algo como
  • DirectoryIndex index.php index.phtml index.html index.htm para servir también los archivos de índice php y luego reiniciar Apache

No olvide reiniciar el servidor Apache para que tenga efecto: systemctl restart httpd.service

Espero que esto ayude. Primero pensé que mi problema eran las directivas de Apache, así que publico mi solución aquí.


Prueba esto

Reemplazar

<Directory /usr/share/phpMyAdmin/> <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>

Con este:

<Directory "/usr/share/phpMyAdmin/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory>

Agregue la siguiente línea para facilitar el acceso:

Alias /phpmyadmin /usr/share/phpMyAdmin


Reemplace el contenido de la primera etiqueta <directory> .

Retirar:

<Directory /usr/share/phpMyAdmin/> <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>

Y coloca esto en su lugar:

<Directory /usr/share/phpMyAdmin/> Order allow,deny Allow from all </Directory>

No te olvides de reiniciar Apache después.


Solo comenta todas las líneas en el primer directorio. O puede eliminar estas líneas, pero es mejor mantenerlas en el caso de que más adelante desee agregar algunas restricciones, pero no comentará.

#<Directory /usr/share/phpMyAdmin/> # <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>


usa esto, se me arregló, sobre centOS 7

<Directory /usr/share/phpMyAdmin/> Options Indexes FollowSymLinks MultiViews AllowOverride all Require all granted </Directory>