1,/etc/httpd/conf.d 目录下新增 vhost.conf,添加内容如下:
<VirtualHost *:80>
#绑定的主域
ServerName centos7.xxx.com
#绑定的子域名
ServerAlias localhost
#网站主目录
DocumentRoot /var/www/html/
#日志配置
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log common
#ServerSignature Off
</VirtualHost>
#测试一的配置
<Directory "/var/www/html/">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<VirtualHost *: