search

Home  >  Q&A  >  body text

javascript - When multiple virtual hosts are configured under WAMP, how can other computers control which website they access?

Configure two vhosts under httpd-vhosts.conf

<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>

The corresponding configuration has also been added to the Windows host file

127.0.0.1       localhost
127.0.0.1       www.mvc.com

But other computers access this machine or localhost through IP. How to let other machines access www.mvc.com?

PHP中文网PHP中文网2766 days ago604

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-06-10 09:49:24

    Other machines need to be bound to the host of your machine’s IP. The domain name is www.mvc.com

    reply
    0
  • Cancelreply