我的计算机中有多个项目在htdocs中我想从同一行的其他计算机访问它们。我已更改主机文件中的所有设置
127.0.0.1 wheels.dev
127.0.0.1 property.dev
127.0.0.1 myproperty.dev
并在http.conf
<VirtualHost *:80>
#ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "C:/xampp/htdocs/wheel/"
ServerName wheel.dev
ServerAlias www.wheel.dev
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
#ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "C:/xampp/htdocs/property/public"
ServerName property.dev
ServerAlias www.property.dev
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
#ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "C:/xampp/htdocs/myproperty/public"
ServerName myproperty.dev
ServerAlias www.myproperty.dev
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
当我尝试访问 whell.dev 或我的 property.dev 时,只有myproperty网站没有任何其他网站请帮我解决我应该更改的内容我的项目中还有更多 谢谢
答案 0 :(得分:0)
当vhosts仅侦听127.0.0.1时,它只会托管该框本身。从任何其他IP(LAN中的计算机),它将托管默认主机。 vhost应配置为还侦听主机在LAN中的IP(192.168 .....)