-->

Cetos 7 配置LAMP的解决办法

2021-01-20 16:47发布

一、什么是LAMP
LAMP指的Linux(操作系统)、Apache HTTP 服务器,MySQL(有时也指MariaDB,数据库软件)和PHP(有时也是指Perl或Python)的第一个字母,一般用来建立web应用平台。所有组成产品均是开源软件,是国际上成熟的架构框架,很多流行的商业应用都是采取这个架构,和Java/J2EE架构相比,LAMP具有Web资源丰富、轻量、快速开发等特点,微软的.NET架构相比,LAMP具有通用、跨平台、高性能、低价格的 优势,因此LAMP无论是性能、质量还是价格都是企业搭建网站的首选平台。

下面讨论如何在RHEL/CentOS/Scientific Linux 7上搭建LAMP环境.
二、如何安装
1、安装 php
yum install php php-mysql php-gd php-pear -y
2、安装phpmyadmin
yum install epel-release
yum install phpmyadmin -y
3、phpmyadmin远程配置
默认,phpMyAdmin只能由本机访问。为了能够远程访问,编辑phpmyadmin.conf file:







vi /etc/httpd/conf.d/phpMyAdmin.conf
查找/<Directory> ,注释掉或删除如下内容

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

添加

<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

标签: