阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

在Fedora 27/Fedora 26/25/24上安装phpMyAdmin

216次阅读
没有评论

共计 2041 个字符,预计需要花费 6 分钟才能阅读完成。

phpMyAdmin 是用于管理 MySQL,MariaDB 和 Drizzle 服务器的基于 Web 的管理工具; 它有助于执行数据库活动,如创建,删除,查询,表,列,关系,索引,用户,权限等。

本指南将帮助您在 Fedora 27/Fedora 26/25 上安装 phpMyAdmin。

安装 phpMyAdmin

使用以下命令安装 phpMyAdmin。

dnf -y install phpmyadmin httpd

配置 phpMyAdmin

默认情况下,phpMyAdmin 将 web 配置文件放在 /etc/httpd/conf.d 目录中; 它有规则和访问权限。phpMyAdmin 只能从 localhost 访问,以改变它; 我们必须编辑 phpMyadmin.conf 文件。

在 Fedora 中,Web 访问由 mod_authz_core.c 模块管理; 所以正常的允许或拒绝规则即使你修改也行不通。

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

默认配置如下所示。

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

请注释掉需要 ip 127.0.0.1 并且要求 ip :: 1 然后在注释行中添加要求所有授予的权利。它将如下所示。

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

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

重新启动 Apache 服务。

systemctl restart httpd

配置防火墙以允许来自外部网络的 HTTP 请求。

firewall-cmd --permanent --add-service=http
firewall-cmd --reload

访问 phpMyAdmin

现在从浏览器访问 phpMyAdmin,URL 将是

http://your-ip-address/phpMyAdmin

以 root 用户身份登录(数据库管理员)或数据库用户。

在 Fedora 27/Fedora 26/25/24 上安装 phpMyAdmin

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计2041字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中