Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 921  / 1 Year ago, tue, march 7, 2023, 9:12:13

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.


More From » 16.04

 Answers
6

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


[#5770] Tuesday, March 7, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itchlos

Total Points: 486
Total Questions: 115
Total Answers: 110

Location: Macau
Member since Fri, Apr 28, 2023
1 Year ago
;