[精讚] [會員登入]
9784

[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

你可能感興趣的文章

[Linux] 怎麼修改終端機console下ls的顏色? 在linux下的ls使用--color的參數時,雖然目錄有上色,但是顏色是深藍色很難辨識,要怎麼修改呢?

安裝網頁套件管理程式 Bower 一個非常棒的Javascript套件管理程式bower,用完愛不釋手。

使用mutt發信(LINUX直接寄信) mutt是一個簡易的發送程式,學會他就不用每次telnet mail server 煩死人

[Linux] 刪除last/lastb登出入記錄 linux shell的登出入記錄

[Centos7] 把帳號新增移除具有root權限等級的sudoer 把帳號新增或移除具有root權限等級的sudoer

[Centos7] SSL自簽憑證+APACHE+Selinux SSL的自簽憑證

隨機好文

HP SAS硬碟leds燈號說明 HP SAS硬碟leds燈號(hp g7/g6系統適用)說明

沒有非誰做不可的事,也沒有不可被取代的人 沒有非誰做不可的事,也沒有不可被取代的人

看懂DSUB DVI HDMI USB等各式影音接頭 看懂DSUB DVI HDMI等各式影音接頭

好用的3+2碼郵遞區號查詢系統推薦 網路上找到用地址輸入判斷3+2碼郵遞區號的辨識率不高,除了這個網站…

世紀帝國征服者新版本--被遺忘的帝國 世紀帝國征服者新版本--被遺忘的帝國 世紀二代的征服者是精典遊戲中的精典,aofe更好玩...