[PYTHON] The day when the flask server running on linux on AWS was semi-persistent (running in the background)

When starting the linux server on aws, if the ssh login is cut off, the server will go down, so I want to solve it!

It looks like you should start it like this!

python


nohup COMMAND >out.log 2>err.log &

When starting the flask file run.py, I commanded as follows.

python


nohup FLASK_APP=run.py FLASK_DEBUG=1 nohup flask run --host='0.0.0.0' --port=5000 >out.log 2>err.log &

reference

https://www.ukeyslabo.com/linux/ps-bg/ ↓ Almost this article is mom https://mick3355-dev.hatenablog.com/entry/2018/04/16/125133

Recommended Posts

The day when the flask server running on linux on AWS was semi-persistent (running in the background)
Run the task in the background on the sshed server
Stumble on dynamic linking when running binary in Pyinstaller (Linux) Resolved
The day when basic authentication was added to the service operated by flask
The story when I was using IntelliJ on Linux and could not input Japanese
Eliminate password entry when running sudo ~~ on Linux PCs!
[AWS CLI] Enable the AWS CLI on Red Hat Enterprise Linux 8
About the --enable-shared option when building Python on Linux
Behavior when Linux less ends depending on the connection source
Install the latest version of Git on your Linux server