![](/img/trans.png)
[英]httpd-xampp.conf: Allow Access to an external system using Host Name instead of IP Address?
[英]XAMPP setup to use name instead of IP address
我有一个用于公司的内部网络,并且在其中一台服务器中,我具有XAMPP / Apache设置并拥有自己的网站。
我可以通过输入以下地址从网络中任何地方的浏览器访问该页面:
http://10.10.239.306/MyPage/testpage.php
我正在尝试进行更改,以便用户可以输入例如IP而不是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服务器。
有人知道我在做什么错以及如何解决吗?
尝试更改监听 127.0.0.1 hweb,请检查以下链接; http://sustainablewebdesign.com/book/resources/xampp/
Internet Name Resolution
表示您的浏览器不知道hweb
的IP。 也就是说,您没有在客户端计算机(尝试访问的hosts
上编辑hosts
文件。
请验证客户端计算机上的C:\\Windows\\system32\\driver\\etc\\host
是否具有10.10.239.306 hweb
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.