最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

在CentOS上安装phpMyAdmin的教程

来源:动视网 责编:小采 时间:2020-11-09 20:58:02
文档

在CentOS上安装phpMyAdmin的教程

在CentOS上安装phpMyAdmin的教程:前提 在CentOS上安装phpMyAdmin,你第一步需要架设一台Web服务器(如Apache或nginx),安装好MySQL/MariaDB数据库和PHP。根据你的偏好和需求,你可以从LAMP和LEMP中选择一种安装。 另一个要求是允许在你的CentOS上安装EPEL库。如果你还没设置过请猛戳
推荐度:
导读在CentOS上安装phpMyAdmin的教程:前提 在CentOS上安装phpMyAdmin,你第一步需要架设一台Web服务器(如Apache或nginx),安装好MySQL/MariaDB数据库和PHP。根据你的偏好和需求,你可以从LAMP和LEMP中选择一种安装。 另一个要求是允许在你的CentOS上安装EPEL库。如果你还没设置过请猛戳


前提

在CentOS上安装phpMyAdmin,你第一步需要架设一台Web服务器(如Apache或nginx),安装好MySQL/MariaDB数据库和PHP。根据你的偏好和需求,你可以从LAMP和LEMP中选择一种安装。

另一个要求是允许在你的CentOS上安装EPEL库。如果你还没设置过请猛戳这里。
在CentOS6或7上安装phpMyAdmin

一旦你设置了EPEL库,你就能轻松地用以下命令安装phpMyAdmin了。

在CentOS 7上:

 $ sudo yum install phpmyadmin 

在CentOS 7上:

 $ sudo yum install phpmyadmin php-mcrypt 

在CentOS 7上配置phpMyAdmin

默认情况下,CentOS 7上的phpMyAdmin只允许从回环地址(127.0.0.1)访问。为了能远程连接,你需要改动它的配置。

用文本编辑器打开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>
 
 <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>
 . . . . .

最后,重启httpd使改动生效。

 $ sudo systemctl restart httpd 

在CentOS 6上配置phpMyAdmin

默认情况下,CentOS 6上的phpMyAdmin是禁止从每个IP地址访问的。为了能远程连接,你需要改动它的配置。

用文本编辑器打开phpMyAdmin的配置文件(路径:/etc/httpd/conf.d/phpMyAdmin.conf),找出并注释掉"Deny from all"字样的代码行。然后把"Allow from 127.0.0.1"字样的代码行改成"Allow from 0.0.0.0"。重新改动过的配置文件如下所示。

 $ sudo vi /etc/httpd/conf.d/phpmyadmin.conf 

 <Directory "/usr/share/phpmyadmin">
 Order Deny,Allow
 # Deny from all
 Allow from 0.0.0.0
 </Directory>

下一步是将phpMyAdmin的配置文件用blowfish加密工具加密。这一步需要加密cookie里的密码来作为基于cookie的部分认证。

用文本编辑器打开如下路径所示的文件并且用blowfish设置一个随机密码,如下所示。

 $ sudo vi /usr/share/phpmyadmin/config.inc.php 

 $cfg['blowfish_secret'] = 'kd5G}d33aXDc50!'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

最后,重启httpd使改动生效。

 $ sudo service httpd restart 

测试phpMyAdmin

测试phpMyAdmin是否设置成功,访问这个页面:http://<web-server-ip-addresss>/phpmyadmin

您可能感兴趣的文章:

  • CentOS 6.2使用yum安装LAMP以及phpMyadmin详解
  • centos下安装配置phpMyAdmin的方法步骤
  • CentOS7 LNMP+phpmyadmin环境搭建 第三篇phpmyadmin安装
  • centos6.4+nginx+mysql+php+phpmyadmin整合过程详解
  • CentOS7 LNMP+phpmyadmin环境搭建 第二篇LNMP环境搭建教程
  • CentOS7 LNMP+phpmyadmin环境搭建 第一篇虚拟机及centos7安装
  • Centos7.2 编译安装方式搭建 phpMyAdmin
  • CentOs 7.*中配置安装phpMyAdmin的完整步骤记录
  • 文档

    在CentOS上安装phpMyAdmin的教程

    在CentOS上安装phpMyAdmin的教程:前提 在CentOS上安装phpMyAdmin,你第一步需要架设一台Web服务器(如Apache或nginx),安装好MySQL/MariaDB数据库和PHP。根据你的偏好和需求,你可以从LAMP和LEMP中选择一种安装。 另一个要求是允许在你的CentOS上安装EPEL库。如果你还没设置过请猛戳
    推荐度:
    标签: 安装 安装包 centos
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top