简体   繁体   中英

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

I use 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 . 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/ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM