配置/etc/hosts文件,192.168.1.209 对应的域名如下:
192.168.1.209 www.name1.com
编辑每个域名的配置文件:
<VirtualHost 192.168.1.209:80>
???????ServerName www.name1.com
???????DocumentRoot ??/var/www/html
???????<Directory "/var/www/html">
???????????????Options Indexes FollowSymLinks
???????????????AllowOverride ???None
???????????????Require all granted
???????</Directory>
</VirtualHost>
CentOS 7----Apache基于域名的虚拟主机配置
原文地址:https://www.cnblogs.com/5aiQ/p/9471499.html