python - vagrant (bento/ubuntu-16.04) 中的端口转发和 localhost 也没有打开
问题描述
我正在尝试使用带有 vagrant(bento/ubuntu-16.04)的数据库在 python 中创建一个 Web 服务器。
vagrant 支持所有端口转发。然后在执行 ``python webserver.py``` 但 localhost 没有打开之后。
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-16.04' version '2.3.5' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8000 (guest) => 8000 (host) (adapter 1)
default: 8080 (guest) => 8080 (host) (adapter 1)
default: 5000 (guest) => 5000 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
然后
$ python webserver.py
显示“在端口 8080 上运行的 Web 服务器”
但本地主机没有打开。并展示这个
Safari cant open the page "localhost:8080/hello" because the server unexpected dropped the connection.
解决方案
推荐阅读
- c - 取消引用“void *”指针
- r - R中的对角矩阵?
- ajax - 如何检查从服务器收到的响应是 html 还是 json 并在 extjs 中按名称查找 html 表单?
- python - 安装 pipenv 时无法构建轮子错误
- python - 熊猫,了解数据框行为
- c - 如何修复核心转储?
- corda - Corda HSM - 支持 SoftHSM
- ffmpeg - 如何修复 FFmpeg 中的“数据包不匹配 -92141241 11 214124”错误?
- html - 如何在视图页面中使用 @Html.ActionLink 中的 count()?MVC
- mysql - 使用MYSQL递归函数显示日期范围内的所有数据