在本地桌面计算机上替换 someaddress.com

发布于 2024-08-28 03:41:41 字数 409 浏览 11 评论 0原文

这是具有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昵称有卵用 2024-09-04 03:41:41

也许您的发行版更喜欢 DNS 而不是 /etc/hosts 中的值。
检查/etc/nsswitch.conf。它应该有一个类似于以下内容的主机行:

hosts: files dns

只需确保 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:

hosts: files dns

Just make sure files comes before dns.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文