centos 7 apache marriad php
1安装apache
yum install httpd httpd-devel
2启动apache
systemctl start httpd
3若要开机运行
systemctl enable httpd
4防火墙开启80端口,让httpd通过
firewall-cmd –permanent –zone=public –add-service=http
或者
firewall-cmd –permanent –zone=public –add-port=80/tcp
5安装mariadb mysql的替代软件
yum install mariadb mariadb-server mariadb-libs mariadb-devel
6启动mariadb
systemctl start mariadb
7若要开机运行
systemctl enable mariadb
8数据库安全设置
mysql_secure_installation
9安装php centos7默认php版本为php5.4
yum -y install php
10用rpm -ql php来查询php的环境
11按需安装php的组件
yum install php-组件名称
12 重启httpd服务
systemctl restart httpd