我有运行 Ubuntu 12.04 LTS 操作系统的 Vagrant/VirtualBox。我已将 Vagrant 配置为将访客端口 8000 转发到我的主机端口 8888。
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 8000 => 8888 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
当虚拟机启动时,我在端口 8000 上启动了一个 Django 开发服务器。
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
好的,我可以把它放在后台,我什curl localhost:8000
至可以从服务器获取一些输出
<div id="explanation">
<p>
You're seeing this message because you have <code>DEBUG = True</code> in your
Django settings file and you haven't configured any URLs. Get to work!
</p>
</div>
但是当我尝试使用 Firefox/Chrome/Telnet 从我的主机上访问服务器时,我得到了 Connection Reset/Connection Lost/ERR_CONNECTION_RESET 等。
首先我认为这可能是一些 iptables 的东西,但事实证明 Ubuntu 默认允许一切。我还关闭了主机上的防火墙。我怎样才能找到这件事的底部?