# 安装阿帕奇
yum install httpd -y
# 开启服务
systemctl start httpd
- 添加阿帕奇工作空间
修改/etc/httpd/conf/httpd.conf配置文件
指定阿帕奇workspace为/var/www/html
修改前
<Directory>
AllowOverride none
Require all denied
</Directory>
修改后
<Directory "/var/www/html">
AllowOverride none
Require all denied
</Directory>
- 启动服务
systemctl start httpd
- 域名绑定
在/etc/httpd/conf目录下创建default.conf添加如下内容
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName www.lidg.vip
<VirtualHost>
DocumentRoot:工作空间
ServerName:域名