Week 11—Nohup?
Truly the Last Step for Uploading Your Website!!
Feb 10, 2022
--
So, now that we have our server up and running through SSH, you might be thinking, “what if we quit SSH and the connection stops?” Well, there is a solution to this! A simple command, which is commonly referred to as “nohup.”
While your server is running on your git bash, input the following command:
nohup puthon app.py &
This command keeps the app.py file running even when you quit git bash. If you want to close down the server, you can use the following method:
# Find the PID (Process ID) of the Python process
ps -ef | grep 'app.py'# kill the process
kill -9 [PID]
Pretty simple, right?
Fin.