1

I connect to my server via ssh that has erlang and cowboy installed on it for running my webpage.

ssh root@my.ip.adress

I then start up my webapp by doing;

./_rel/web_server_example/bin/web_server_example console

Which leaves me at a final line containing;

(web_server_example@127.0.0.1)1> 

the erlang prompt. Now I need both the server and my home computer that is connected to it, because if I close the terminal it stops the erlang program on the server. How can I keep the program running and have my home computer off?

RiaanV
  • 223

1 Answers1

6

You have (at least) 2 options:

1) Use nohup. Command:

nohup ./_rel/web_server_example/bin/web_server_example console &

then you can exit your ssh session. The output of your process will be redirected to file nohup.out

2) Use GNU screen. You will likely need to install it first: apt-get install screen. Then:

screen bash
./_rel/web_server_example/bin/web_server_example console
<Ctrl-A> D

At this stage you will have a screen session running in the background. You can exit your ssh session. The beauty of the screen way of doing things is that you can re-attach later. Log on to that server and type in command screen -r. You will back to your web_server_example command and you can do things like pressing to interrupt it or interract with it in some other way.

sмurf
  • 4,750
  • 1
  • 26
  • 30