在本地桌面计算机上替换 someaddress.com
这是具有 IP(例如 105.123.123.123)和正在运行的 apache 服务的 VDS 服务器。 还有一台装有 Linux 的台式计算机(但实际上我认为没有区别)。我需要在网络浏览器地址(例如 someaddress.com)上输入并查看位于我的服务器上的网站。 我的/etc/hosts:
127.0.0.1 localhost
105.123.123.123 someaddress.com
105.123.123.123 www.someaddress.com
但它不起作用。我看到了真实的 someaddress.com 网站。可能有什么问题。如果你能帮我的话那就太好了。
PS 为什么我需要这个。有一个项目具有固定链接(例如 someaddress.com/inf)。我需要测试它。
Here is VDS server with ip(for example 105.123.123.123) with working apache service.
And there is a desktop computer with linux on board(but really I presume there is no difference). I need to type on web browser address like someaddress.com and to see website situated at my server.
My /etc/hosts:
127.0.0.1 localhost
105.123.123.123 someaddress.com
105.123.123.123 www.someaddress.com
But it doesn't work. I see real someaddress.com website. What can be wrong. It will be great if you help me with that.
P.S. Why I need this. There is one project with fixed links(like someaddress.com/inf). And I need to test it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您的发行版更喜欢 DNS 而不是 /etc/hosts 中的值。
检查/etc/nsswitch.conf。它应该有一个类似于以下内容的主机行:
只需确保 files 位于 dns 之前。
Maybe your distribution is preferring DNS over values in /etc/hosts.
Check /etc/nsswitch.conf. It should have a hosts line something like:
Just make sure files comes before dns.