1. # 安装阿帕奇
    2. yum install httpd -y
    3. # 开启服务
    4. systemctl start httpd
    1. 添加阿帕奇工作空间
      修改/etc/httpd/conf/httpd.conf配置文件
      指定阿帕奇workspace为/var/www/html
      修改前
    1. <Directory>
    2. AllowOverride none
    3. Require all denied
    4. </Directory>

    修改后

    1. <Directory "/var/www/html">
    2. AllowOverride none
    3. Require all denied
    4. </Directory>
    1. 启动服务
    1. systemctl start httpd
    1. 域名绑定
      在/etc/httpd/conf目录下创建default.conf添加如下内容
    1. <VirtualHost *:80>
    2. DocumentRoot "/var/www/html"
    3. ServerName www.lidg.vip
    4. <VirtualHost>

    DocumentRoot:工作空间
    ServerName:域名