【发布时间】:2013-11-11 14:13:21
【问题描述】:
我有一个我们公司的内部网络,在其中一台服务器上我安装了 XAMPP/Apache 并拥有自己的网站。
我通过输入以下地址从网络中任何地方的浏览器访问该页面:
http://10.10.239.306/MyPage/testpage.php
我正在尝试更改,以便用户可以输入而不是 IP(很难记住),例如:
http://hweb/MyPage/testpage.php
我按照在线说明在托管页面的服务器上进行了以下更新:
在我添加的C:\Windows\system32\driver\etc\host 文件中:
127.0.0.1 hweb
在我添加的C:\xampp\apache\conf\extra\httpd-vhosts.conf 文件中:
<VirtualHost *:80>
ServerName hweb
ServerAlias myname
DocumentRoot c:/xampp/htdocs/MyPage
</VirtualHost>
当我在浏览器中输入http://hweb/MyPage/testpage.php 时,我收到Internet Name Resolution Error (dns_server_failure) 错误
我确实重启了 Apache 服务器两次。
有谁知道我做错了什么以及如何解决?
【问题讨论】:
-
10.10.239.306 hweb >> [ /etc/hosts || C:\Windows\System32\drivers\etc\hosts]
-
我在托管 XAMPP 服务器的机器上编辑了它。
-
IP 解析实际上需要由 Intranet 路由器完成(如在 Google HQ 中 - 他们使用
go[ 即 go/ethics ] 作为其内部命名空间)或在客户端 -机器。
标签: php apache xampp localhost host