Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

run as daemon under linux #934

Closed
hoFFy84 opened this issue Aug 8, 2017 · 11 comments
Closed

run as daemon under linux #934

hoFFy84 opened this issue Aug 8, 2017 · 11 comments

Comments

@hoFFy84
Copy link

hoFFy84 commented Aug 8, 2017

Hi,

I'm trying to get Gekko running on my VPS under Ubuntu. I'm connecting via putty to my server. When I now start Gekko with node gekko --ui then I can't get back to the bash. I have to leave the putty window open forever, or hope that the ssh session won't be closed if I simply close the putty window.

Another thing is, I'm using nginx reverse proxy with authentication, but I always see the "Disconnected" window. Side note: I haven't had the time so far to adjust my letsencrypt certificate with the new subdomain I'm running gekko with. Could that play a role?

@thegamecat
Copy link

I'm a really big fan of pm2

http://pm2.keymetrics.io/

@hoFFy84
Copy link
Author

hoFFy84 commented Aug 8, 2017

Wow thanks for that fast response! PM2 works for me now - one thing solved.

But I'm always seeing the "Disconnected", no matter what page I try to connect to "/#/home" "/#backtest" ...

@thegamecat
Copy link

I'm going to guess that's a port thing. Bit out of my comfort zone.

@metachris
Copy link
Contributor

Have you followed all setup instructions from here?

If so, perhaps the webserver is not correctly set up or the firewall doesn't allow access.

I would recomment you test connecting to the webserver from your local terminal: curl -vvvv <your-url>. Does this work? If not, what's the output?

@hoFFy84
Copy link
Author

hoFFy84 commented Aug 8, 2017

I updated the letsencrypt certificate, just to be safe that this doesn't make any problems.

curl tells something about the SSL connection and then that it's not authenticated. But thats OK, because I want authentication... its a server running in the web.

* Rebuilt URL to: https://XXX.org/
*   Trying EXTERNALIPHERE...
* Connected to XXX.org (EXTERNALIPHERE) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 694 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: XXX.org (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: CN=XXX.org
*        start date: SOMEDATE
*        expire date: SOMEDATE
*        issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
*        compression: NULL
* ALPN, server accepted to use http/1.1
> GET / HTTP/1.1
> Host: XXX.org
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Server: nginx
< Date: Tue, 08 Aug 2017 14:35:34 GMT
< Content-Type: text/html
< Content-Length: 188
< Connection: keep-alive
< WWW-Authenticate: Basic realm="Restricted Content"
<
<html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host XXX.org left intact

@metachris
Copy link
Contributor

This is good because at least we know the SSL cert is ok and nginx asks for basic auth now. Next step is to check whether nginx can properly connect to the upstream http server of gekko.

Run this curl command (fill in your username and password):

curl -vvvv -u <user>:<password> <your-url>

And post the output (don't post the password, obviously ; )

@askmike
Copy link
Owner

askmike commented Aug 8, 2017

Another note, the Disconnected window is displayed if the UI loads (=your browser can access the gekko server via GET calls) but the UI fails to setup a websocket connection. The UI requires a persistent websocket connection between the UI and the backend server (through nginx).

@gweedobtc
Copy link

I use nodemon with screen. This way, when I do git pulls on my server or change a configuration file, nodemon reloads. Then I don't have to worry about going into each screen session to do a restart. Also, screen will keep the ssh session open even after you disconnect.

@askmike
Copy link
Owner

askmike commented Aug 8, 2017

This way, when I do git pulls on my server or change a configuration file, nodemon reloads.

Note that currently if you restart the UI it won't restart all your gekkos you had running.

@hoFFy84 if you are still having issues with the Disconnected window please open another issue, it's hard to debug two issues at once (well the one in the title is fixed I think).

@askmike askmike closed this as completed Aug 8, 2017
@hoFFy84
Copy link
Author

hoFFy84 commented Aug 11, 2017

Solved it! My fault...
First of all: I had to restart the server, don't know why, but I wasn't able to start Gekko with pm2 any more. After rebooting the server I focused on the Disconnected, adjusted some configs, and hours later I came across just one line: 0|gekko | Serving Gekko UI on https://contoso.com:3000/
After that I corrected my UIconfig.js and changed the port for the ui to 443... as the documentation said. I didn't read it exactly. Thank you!!

@askmike
Copy link
Owner

askmike commented Aug 11, 2017

great to hear!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants