Centos 7.6搭建LAMP

前端之家收集整理的这篇文章主要介绍了Centos 7.6搭建LAMP前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
一、准备环境
关闭SeLinux
临时关闭:setenforce 0

永久关闭:vi /etc/selinux/config

分享图片

关闭防火墙

临时关闭:systemctl stop firewalld.service

永久关闭:systemctl disable firewalld.service

二、安装环境 LAMP 

1、安装apache

yum install -y httpd

httpd服务开机进行自启:systemctl enable httpd

启动httpd服务:Systemctl start httpd

开启80端口:iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

安装MysqL ,因为7版本MysqL要收费,所以我们安装mariadb

yum install -y mariadb mariadb-server

运行服务

systemctl start mariadb

开机自启动:systemctl enable mariadb

查看Mariadb是否安装成功:systemctl status mariadb

安装PHP环境

yum install -y PHP PHP-MysqL
放入测试文件
cd  /var/www/html
echo hello eric >index.PHP

猜你在找的CentOS相关文章