Running gekko on a ubuntu server with apache
#1
Hello!

My knowledge of linux, apache and nodejs is not that great.
But has someone a good detail description for me, how I can run it on an apache server (linux)?
  Reply
#2
hi
ubuntu is easier but you do not
terminal open
-------------------------
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential

sudo apt-get install git

git clone git://github.com/askmike/gekko.git
cd gekko
npm install --only=production

node gekko --ui

http://localhost:3000

In bash hold ctrl + c. Smile
--------------------------------
for server
----------------------------------
https://gekko.wizb.it/docs/installation/...erver.html
  Reply
#3
@ankasem your instructions work but it is recommended to put a webserver in front of the gekko server (with security like basic auth), unless you are talking about running Gekko on a ubuntu desktop.

@SettusBlake I haven't used Apache in years, the link from ankasem guides you through how to use nginx (instead of apache).

Note that specifically for not super tech savy people who have trouble installing and managing their server I am setting up a service where I will run Gekko for you in the cloud, see here for more info: https://forum.gekko.wizb.it/thread-1435.html
  Reply
#4
Ok, now I have a AWS Server with ubuntu and nginx installed. I tried the guide, but I cant get it do run.
  Reply
#5
(02-14-2018, 08:10 AM)SettusBlake Wrote: Ok, now I have a AWS Server with ubuntu and nginx installed. I tried the guide, but I  cant get it do run.

So now what? How do you think someone can give you advice, when you don't give us any details about where you're stuck. For instance: What's the error message?  Huh
Even in 2018, magic glassballs are still not functioning properly.
  Reply
#6
Hi guys. Just installed it on nginx, this is my config file:



PHP Code:
upstream websocket {
   server localhost:3000;
}

server {

       listen 80 default_server;
       listen [::]:80 default_server;


   location / {
           proxy_buffers 8 32k;
           proxy_buffer_size 64k;

           proxy_pass http://websocket;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header Host $http_host;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_set_header X-NginX-Proxy true;

           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";

           proxy_read_timeout 86400s;
           proxy_send_timeout 86400s;
           auth_basic "Restricted Content";
           auth_basic_user_file /etc/nginx/.htpasswd;

       }


and this is my UIconfig.js


PHP Code:
const CONFIG = {
   headlesstrue,
   api: {
       host'127.0.0.1',
       port3000,
   },
   ui: {
       sslfalse,
       host'...',
       port80,
       path'/' // change this if you are serving from something like `example.com/gekko`
   },
   adapter'sqlite'
}

if(
typeof window === 'undefined')
 module.exports CONFIG;
else
 window.CONFIG CONFIG


I want to run it over SSL, I generated an SSL cert with letsencrypt like I usually do and placed it in the nginx conf, but it just times out. Does anyone have a working example of an nginx conf and UIconfig.js with SSL enabled? I think there's some issue with the reverse proxy.

This is my config with https on:

PHP Code:
server {
    listen 80;
    listen [::]:80;
    server_name ...;
    return 301 https://$server_name$request_uri;
}

upstream websocket {
    server localhost:3000;
}

server {

    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    root /var/www/html;
    ssl_certificate /etc/letsencrypt/live/.../fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/.../privkey.pem;

    location / {

        proxy_buffers 8 32k;
        proxy_buffer_size 64k;

        proxy_pass http://websocket;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_read_timeout 86400s;
        proxy_send_timeout 86400s;
    }

  Reply
#7
Does your firewall block port 443? ALso, you have to edit the ui config and set SSL to true and set the port to 443.
  Reply
#8
(02-14-2018, 04:08 PM)SirTificate Wrote: Does your firewall block port 443? ALso, you have to edit the ui config and set SSL to true and set the port to 443.

Ah man that was it, I copied a wrong security group on AWS. You're awesome! thanks!

@SirTificate, what's your suggestion on running the node process as a daemon? Sorry, coming from PHP Smile
  Reply
#9
i tried to set this up on AWS EC2 everything seemed to work but at the last step when i try to set username and PW i get this error:

Quote:printf "username:`openssl passwd -apr1`\n" >> /etc/nginx/.htpasswd
Password:
Verifying - Password:
-bash: /etc/nginx/.htpasswd: Permission denied

I tried to google the issue but could not find anything that solved it. tried to set permissions and so on. but cannot seem to write or modify the file.

when i try to start the nginx service i get this error:

Quote:service nginx start
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

In the details i see:

Quote:systemctl status nginx.service

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-02-15 13:27:28 UTC; 2min 15s ago
  Process: 1973 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Feb 15 13:27:28 ip-172-31-35-179 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 15 13:27:28 ip-172-31-35-179 nginx[1973]: nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64
Feb 15 13:27:28 ip-172-31-35-179 nginx[1973]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 15 13:27:28 ip-172-31-35-179 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 15 13:27:28 ip-172-31-35-179 systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 15 13:27:28 ip-172-31-35-179 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
In the config file the server_names_hash_bucket_size: 64 is set.

can anybody help me set this up. i want to run gekko on AWS EC2 protected from the outside world and accessible from anywhere with basic authentication.
  Reply
#10
The error message is pretty clear. INCREASE the value!
  Reply


Forum Jump:


Users browsing this thread: