猿问

WAMP下面配置多台虚拟主机,其他计算机如何控制访问哪个网站?

httpd-vhosts.conf下配置vhost两个

<VirtualHost *:80>

    DocumentRoot "G:\PhpDemo"

    ServerName "localhost"

    <Directory "G:\PhpDemo">

        Options Indexes FollowSymLinks

        AllowOverride all

        Require all granted 

    </Directory>

</VirtualHost>


<VirtualHost *:80>

    DocumentRoot "G:\MVC"

    ServerName "www.mvc.com"

    <Directory "G:\MVC">

        Options Indexes FollowSymLinks

        AllowOverride all

        Require all granted 

    </Directory>

</VirtualHost>

在windows的host文件中也添加了对应的配置

127.0.0.1       localhost

127.0.0.1       www.mvc.com

但是其他计算机通过ip访问本机还是localhost,如何让其他机器访问到www.mvc.com?

红糖糍粑
浏览 423回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答