I have 2 flask restful API's .
On my localhost, I open up a terminal and run uwsgi --ini /path-to-ini-file1. For 2nd API, I open up yet agan a new terminal and run uwsgi --ini /path-to-ini-file2.
In VPS, I have only a single ssh window.
How do I run those 2 on terminals in vps using ssh. Should I create a bin/bash script to achieve that?
Any suggestion would be appreciated, thank you.
Asked
Active
Viewed 1,189 times
0
ksalf
- 3
2 Answers
0
To run commands in background and do not have them attach to the terminal you need to use something like:
nohup uwsgi --ini /path-to-ini-file1 >out1.log 2>err1.log&
nohup uwsgi --ini /path-to-ini-file2 >out2.log 2>err2.log&
And you can run as many as need servers (limited by RAM and processor power).
And after you logour from the server you will have them run
Romeo Ninov
- 709
- 7
- 13
0
If this is supposed to run on an unattended machine, make these a service, so that they are automatically taken care off (started,restarted, logged...). It is not difficult to make a systemd service.
xenoid
- 5,759