我需要的是如下
我可以按如下方式访问本地计算机中的子域,test.localhost
但我需要test.myMachineName
或test.myMachineIp
从我自己网络中的另一台计算机访问
我在本地 wamp 服务器中设置了子域,如下所示:
在 https-vhost.conf 中:
<VirtualHost *:80>
#ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
#ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/wamp/www/test"
ServerName localhost
ServerAlias test.localhost
#ErrorLog "logs/dummy-host.example.com-error.log"
#CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
然后在 httpd.conf 中启用 vhost
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
然后在windows主机中添加如下
127.0.0.1 test.localhost