默认情况下,为了能远程连接phpMyAdmin,你需要改动它的配置。

用文本编辑器打开phpMyAdmin的配置文件(路径:/etc/httpd/conf.d/phpMyAdmin.conf),找出并注释掉带有"Require ip XXXX"字样的代码行。会有四处这样的代码行,用"Require all granted"取而代之。重新改动过的配置文件如下所示。

sudo vi /etc/httpd/conf.d/phpMyAdmin.conf

修改后的文件内容

    <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 all granted   #新添加

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

  。。。

       </IfModule>

    </Directory>

重启httpd使改动生效

#systemctl restart httpd

 

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2021-08-29
  • 2021-11-05
  • 2021-12-05
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2021-06-28
  • 2022-01-06
  • 2021-12-19
  • 2021-11-27
  • 2022-02-08
相关资源
相似解决方案