先更新一下yum源
yum makecache
安装apache:
1.查看是否安装过Apache(CentOS中软件包名为httpd)
yum info httpd
2.如果安装则卸载
yum remove -y "httpd*"
3.安装Apache
yum -y install httpd
4.运行并设置自启动
systemctl start httpd
systemctl enable httpd
systemctl status httpd
安装mariadb (mysql的替代):
1.查看是否安装mariadb
yum info mariadb
yum info mariadb-server
2.卸载已经安装的mariadb
yum remove -y "mariadb*"
3.安装mariadb
yum -y install mariadb mariadb-server