centos8.1下搭建LAMP详细教程

戏子无情 提交于 2020-03-20 17:26:01

3 月,跳不动了?>>>

第一步:安装Apache Web 服务器

# 注:采用该方法安装Apache的配置文件的默认路径在/etc/httpd/conf/httpd.conf

[root@localhost ~]# yum install  -y httpd  httpd-tools 

查看Apache运行状态

[root@localhost ~]# systemctl status httpd

启用Apache服务,并使其在系统启动时启动。

[root@localhost ~]# systemctl  start  httpd
[root@localhost ~]# systemctl enable httpd

检查Web服务器的版本,以确保已正确安装。

httpd -v

接下来我们测试一下Apache Web 服务器是否安装成功

本页面是在 Apache HTTP 服务器测试页 ,完成安装后用来测试它的正常运作。如果你能阅读此页面,此网站已能正常运作。

第二步:安装数据库

1、安装MariaDB

[root@localhost ~]# yum install -y mariadb-server mariadb

然后启动,并在系统启动时,启用MariaDB

[root@localhost ~]# systemctl start mariadb.service 
[root@localhost ~]# systemctl enable  mariadb.service 

查看MariaDB运行状态

systemctl status mariadb.service

最后,我们需要通过secure来保护MariaDB数据库引擎,做好数据库安全

mysql_secure_installation

此过程我们输入root密码,其他选项都选 y 即可 。

第三步:安装PHP7

 

 

 

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!