apache配置多个虚拟主机 localhost访问不了解决方案

在httpd-vhosts.conf,重定向localhostweb

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/PHPAPACHERUN"
    ServerName localhost
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>ast

 

而若是出现访问127.0.0.1的结果不是本身想要的,多是由于httpd-vhosts.conf,存在了多个<VirtualHost *:80>,地址127.0.0.1按顺序解析,解析到第一个,修改DocumentRoot的地址或调整顺序便可。error

相关文章
相关标签/搜索