[英]How to run Flask on EC2 Amazon?
I have done all steps. 我已完成所有步骤。 When I run application I see console message: 当我运行应用程序时,我看到控制台消息:
[ec2-user@ip publisher]$ python __init__.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 111-801-147
My question how to make this script public, that user able to see interface? 我的问题是如何将此脚本公开,使该用户能够看到界面?
I have Public DNS, IPv4 Public IP 我有公共DNS,IPv4公共IP
I use Cent OS 我使用Cent OS
Assuming you instance is reachable from the internet (public subnet of a VPC), make the the server listen on 0.0.0.0
. 假设您的实例可以从Internet(VPC的公共子网)访问,则使服务器侦听0.0.0.0
。 Currently it listens to the local requests only. 当前,它仅侦听本地请求。
After making the change, instead of: 进行更改后,而不是:
Running on http://127.0.0.1:5000/
you will see: 你会看见:
Running on http://0.0.0.0:5000/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.