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?
Other machines need to be bound to the host of your machine’s IP. The domain name is www.mvc.com