【发布时间】:2017-10-21 21:43:33
【问题描述】:
我正在尝试更改从 WAMP 服务器访问我的网站的方式。我可以像 xxx.xxx.xxx.xxx/name 一样访问它,是的,它工作得很好。我搜索了如何将“xxx.xxx.xxx.xxx/name”更改为像 www.name.com 这样的域名,我得到了一些结果,但没有一个有效。这些是我做过的事情:
首先我去了我的主机文件
C:\Windows\System32\drivers\etc
,添加了一行“127.0.0.1 mytestdomain.com”,看起来是这样的: host file
接下来,我将“#Include conf/extra/httpd-vhosts.conf”从位于以下位置的 httpd.conf 更改为“包含 conf/extra/httpd-vhosts.conf”:
"D:\wamp64\bin\apache\apache2.4.27\conf"
.
最后,我补充了
<VirtualHost mytestdomain.com>
DocumentRoot "D:/wamp64/www/myTestDomain/"
ServerName mytestdomain.com
ServerAlias mytestdomain.com
<Directory "D:/wamp64/www/myTestDomain/">
Order allow, deny
Allow from all
</Directory>
</VirtualHost>
“httpd-vhosts.conf”位于:
"D:\wamp64\bin\apache\apache2.4.27\conf\extra"
哦,是的,这是在 myTestDomain 文件夹中:myTestDomain
完成所有这些后,我重新启动了 WAMP 并转到了我的域主,但它似乎没有工作,同时“xxx.xxx.xxx.xxx/myTestDomain”似乎工作。
【问题讨论】:
标签: wampserver