看一看
https://httpd.apache.org/docs/2.2/vhosts/examples.html
了解如何设置虚拟主机。配置文件只有一个虚拟主机条目,但每个站点需要一个条目。而且您的配置缺少服务器名。试试这个:(未经测试)
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
<VirtualHost *:80>
ServerName flowers.loc
DocumentRoot /User/Vizzaro/Sites/drupal8/docroot
# Other directives here
</VirtualHost>
<VirtualHost *:80>
ServerName honey.loc
DocumentRoot /User/Vizzaro/Sites/drupal7/docroot
# Other directives here
</VirtualHost>
确保honey.loc和flowers.loc都指向运行apache的机器的ip。尝试
ping flowers.loc
-如果这会导致如下错误
Name or service not known
您可能需要编辑主机文件来修复它。