[精讚] [會員登入]
9886

[Centos7] 安裝phpMyAdmin

Centos 7有新的方式可以安裝phpmyadmin,不必再採用過去的tarball安裝法。

分享此文連結 //n.sfs.tw/10587

分享連結 [Centos7] 安裝phpMyAdmin@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-10-25 11:27:45 最後編修
2017-01-10 01:03:11 By 張○○
 

自動目錄

Centos 7有新的方式可以安裝phpmyadmin,不必再採用過去的tarball安裝法。

過去我們都先去phpmyadmin下載tarball的檔案下來解壓再安裝,在Centos7不必這麼麻煩。

OS

CentOS Linux release 7.3.1611 (Core)
PHP 5.6.29
mysql  Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1

必要條件

PHP >=5.5,Mysql/ Mariadb 已安裝,防火牆80埠有開

安裝

直接用 yum安裝

# yum install phpmyadmin

如果找不到 phpmyadmin套件,請先安裝 epel repository再安裝即可

安裝 epel
# yum install epel-release

修改APACHE設定

# 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 140.128.x.x/24
       Require ip 211.75.x.x/28
     </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>

第1,2行 修改目錄別名,建議改掉預設的phpmyadmin 以免有漏洞被入侵
第10,11行 增修能存取的ip,若不改預設只有本機能存取

重啟 apache 生效

# systemctl restart httpd

開啟網頁 http://x.x.x.x/phpmyadmin  <== 上面設的別名

selinux

# setsebool httpd_can_network_connect_db on

修改 phpMyAdmin 設定

如果有需要微調的情況,可修改設定檔

# vi /etc/phpMyAdmin/config.inc.php

安裝完成並登入

祝您使用愉快

END

你可能感興趣的文章

[CENTOS7/8] 安裝中文字型 如何在Centos7上安裝和移除中文字型?

EXCEL+phpPgAdmin 使用phpPgAdmin 匯出資料 直接使用phpPgAmin下載資料的方法

[Centos7] selinux 修改網頁連線的埠號 想把網頁改到非標準的80埠,在selinux上要如何修改?

使用dnstop 來觀察dns運作的情形 dnstop是非常方便的工具,可以觀察即時的dns查詢。 安裝 yum install dnstop

[Centos6] 安裝VNC連線程式 在Centos6桌上環境安裝VNC 連線程式

[CentOS8] 1.安裝JULIA 安裝及開始使用 JULIA

隨機好文

[MAC] 截取螢幕畫面的方法 截取螢幕畫面的方法,在MAC中叫作螢幕快照,英文是screenshot

UTF-8 BOM (Byte Order Mark) 的問題 在 Michael Kaplan 那看到 Every character has a story #4: U+feff

[Windows7] 移除IE10及移除IE11 Windows7 不得已的情況要移除IE11或IE10怎麼做?

為什麼要重造輪子? 什麼輪子?造什麼輪子?我為什麼要重造輪子?

設計的工作絕不接受比價 拿買陽春麵的價格想買牛肉麵,寧願倒掉也不賣