Cetos 7 配置LAMP的解決辦法

1、什麼是LAMP
LAMP指的Linux(操做系統)、Apache HTTP 服務器,MySQL(有時也指MariaDB,數據庫軟件)和PHP(有時也是指Perl或Python)的第一個字母,通常用來創建web應用平臺。全部組成產品均是開源軟件,是國際上成熟的架構框架,不少流行的商業應用都是採起這個架構,和Java/J2EE架構相比,LAMP具備Web資源豐富、輕量、快速開發等特色,微軟的.NET架構相比,LAMP具備通用、跨平臺、高性能、低價格的 優點,所以LAMP不管是性能、質量仍是價格都是企業搭建網站的首選平臺。php

下面討論如何在RHEL/CentOS/Scientific Linux 7上搭建LAMP環境.
2、如何安裝
一、安裝 php
yum install php php-mysql php-gd php-pear -y
二、安裝phpmyadmin
yum install epel-release
yum install phpmyadmin -y
三、phpmyadmin遠程配置
默認,phpMyAdmin只能由本機訪問。爲了可以遠程訪問,編輯phpmyadmin.conf file:mysql

vi /etc/httpd/conf.d/phpMyAdmin.conf
查找/<Directory> ,註釋掉或刪除以下內容web

<Directory /usr/share/phpMyAdmin/>sql

AddDefaultCharset UTF-8數據庫

<IfModule mod_authz_core.c>服務器

# Apache 2.4

 <RequireAny>

   Require ip 127.0.0.1

   Require ip ::1

 </RequireAny>

</IfModule>cookie

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

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

添加

<Directory /usr/share/phpMyAdmin/>

Options none

    AllowOverride Limit

    Require all granted

</Directory>

編輯「config.inc.php」 改變phpMyAdmin的authentication,修改「cookie」 爲 「http」

vi /etc/phpMyAdmin/config.inc.php
Change ‘cookie’ to ‘http’.

clip_image003[4]

重啓the Apache service:

systemctl restart httpd

相關文章
相關標籤/搜索