【问题标题】:Access localhost from another computer从另一台计算机访问 localhost
【发布时间】:2015-02-10 00:21:25
【问题描述】:

我在 ubuntu 中创建了虚拟主机 example.local。 我想从网络上的另一台计算机打开它。我怎样才能做到这一点? 我可以使用我的 ip 在 /var/www/html 中打开网站:http://11.22.33.4/example 但是如何从另一台计算机打开http://example.local

【问题讨论】:

标签: apache web virtualhost


【解决方案1】:

为您的服务器创建 DNS 路由 ...

在您的主机文件中:

11.22.33.4    example.local

您可以在此处找到您的主机文件:

Windows:%SystemRoot%\system32\drivers\etc\hosts

Linux/MAC:/etc/hosts

【讨论】:

  • 您也可以将 DNS 路由添加到您的 DNS 服务器,这样您就可以从网络上的每台计算机访问 example.local
猜你喜欢
  • 2019-01-03
  • 2015-08-06
  • 2012-05-22
  • 1970-01-01
  • 2014-02-19
  • 1970-01-01
  • 2016-09-15
  • 2020-08-24
  • 1970-01-01
相关资源
最近更新 更多