一、安装准备 进入root权限
二、安装yum apt-get install yum
三、安装apache服务
(1)更新文件 yum -y update
(2)安装apache yum install httpd
(3)修改配置信息 vim /etc/httpd/conf/httpd.conf
(1)把里面的 AllowOverride None 全部修改为 AllowOverride All
(2)顺便在 DirectoryIndex index.html 后面加上 index.htm index.php index.shtm
(3)直接修改/etc/httpd/conf/httpd.conf中修改DocumentRoot和Directory处的路径、重启即 可
(4)重启apache服务 systemctl restart httpd.service #重启apache
(5)让配置立即生效 setenforce 0 #使配置立即生效
(6)根据需要开启或关闭防火墙 systemctl stop firewalld.service //关闭firewall systemctl start firewalld.service //开启firewall systemctl disable firewalld.service //禁止firewall开机启动
四、安装PHP
(1)安装 yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc
php-mbstring php-snmp php-soap curl curl-devel
(2)重启apache服务 sy