-1

In order to have my site running on a webserver i have to manualy login into it with these commands:

ssh IP
add password
cd chn
source bin/activate
cd chn
python3 manage.py runserver IP:80

And that is it! How i can do all this process to run in the background? PS. The server is running on Linux/Ubuntu14.0 i think. If i put & at the end of each line, i will see them in my terminal, but i am afraid that it will stop all, when i close my mac/termina etc.

root@localhost:~# ps aux | grep 1373
root     30873  0.0  0.0  11724   680 pts/1    S+   14:35   0:00 grep --color=auto 1373
root@localhost:~# ps aux | grep 30827
root     30875  0.0  0.0  11724   676 pts/1    S+   14:36   0:00 grep --color=auto 30827
root@localhost:~# ps aux | grep 30835
root     30835  0.2  3.0 100644 31024 pts/0    S    14:33   0:00 python3 manage.py runserver IP:80
root     30877  0.0  0.0  11724   676 pts/1    S+   14:36   0:00 grep --color=auto 30835

Thank you!

Cohen
  • 944
  • 3
  • 13
  • 40
  • Question not Clear, is it `How I can do all this process to run in the background. ` The The login process or starting the app? – saviour123 Jan 23 '18 at 14:51
  • savior in order to run the server i have to login with ssh add a pass start the virtualenv and to run the server. I need to have my server running in the background all the time, even when i close the terminal, without having me to open it everytime i start my laptop. Thank you! Hope that i was clear! PS keep in mind that i have to run first my virtual environment to make the server running. – Cohen Jan 23 '18 at 14:59
  • PS is my first time when i do this, so pls understand my lack of experience! – Cohen Jan 23 '18 at 15:02
  • 1
    you can use **nohup** command or even write an init script. – LMC Jan 23 '18 at 15:04
  • Thank you nohoup in the front of all of the commands i have and in the back "&" – Cohen Jan 23 '18 at 15:05
  • 1
    Possible duplicate of [How to run process as background and never die?](https://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die) – LMC Jan 23 '18 at 15:10
  • Luiz that is not me! is not a duplicate! – Cohen Jan 23 '18 at 15:13
  • Don't worry. you can look into deploying django app on ubuntu the best way. the you can also use pm2 to start the django app. – saviour123 Jan 23 '18 at 15:23

1 Answers1

0

it worked with this command Nohup python3 manage.py runserver 5.83.45.64:80 &

Cohen
  • 944
  • 3
  • 13
  • 40