【发布时间】:2014-07-15 06:15:42
【问题描述】:
我知道这个问题已经被问过好几次了,我什至在公司里也做过很多次,但是,现在我想在家里设置一个虚拟主机,但它不起作用。
我做了什么:
Added xxx.localhost.de into the hosts
127.0.0.1 xxx.localhost.de
Uncommented include vhosts... in my httpd.conf
Include conf/extra/httpd-vhosts.conf
Set up a virtual host for my project
<VirtualHost *:80>
ServerAdmin asdr@web.de
DocumentRoot "D:\wamp\www\xxx"
ServerName xxx.localhost.de
ServerAlias xxx.localhost.de
ErrorLog "logs/xxx-error.log"
CustomLog "logs/xxx-access.log" common
</VirtualHost>
我没有收到错误 - wamp 仍然可以正常启动,我可以使用正常路径访问它
localhost/...
但是当我尝试通过 xxx.localhost.de 访问它时,我会进入网站“www.localhost.de”。就好像他不关心我的主机文件...
我实际上错过了什么?在我的公司里,它总是这样工作。我也检查了教程,它总是说这是所有需要的步骤。
谢谢!
【问题讨论】:
-
你能ping通
xxx.localhost.de -
是的,但我想我只收到了网站“localhost.de”的回复
-
是的,刚刚检查过 - 它需要“xxx”。作为子域并 ping www.localhost.de
标签: php apache xampp wamp virtualhost