配置虚拟主机后,localhost的访问就会失效,解决方案是在虚拟主机的配置文件里添加localhost虚拟主机,如下:
<VirtualHost _default_:80>
DocumentRoot "/Library/WebServer/Documents/"
ServerName localhost
</VirtualHost>
DocumentRoot 是原来localhost的文档根目录,配置完后保存,重启Apache服务器后就可以用了;
配置虚拟主机后,localhost的访问就会失效,解决方案是在虚拟主机的配置文件里添加localhost虚拟主机,如下:
<VirtualHost _default_:80>
DocumentRoot "/Library/WebServer/Documents/"
ServerName localhost
</VirtualHost>
DocumentRoot 是原来localhost的文档根目录,配置完后保存,重启Apache服务器后就可以用了;