CentOS 7 简单安装 Apache 步骤
Sep 20, 2016
安装Apache
1 | yum install httpd |
启动Apache
1 | systemctl start httpd |
设置自启动
1 | systemctl enable httpd |
防火墙永久打开80端口
1 | firewall-cmd --add-service=http --permanent |
重启防火墙
1 | systemctl restart firewalld |
这时我们访问ip地址可以看见Apache的默认主页
安装php及基础支持
1 | yum install php php-mysql php-pdo php-gd php-mbstring |
新建vhost.conf于/etc/httpd/conf.d
1 | # 虚拟主机 |
重启Apache
1 | systemctl restart httpd |