Picture of Matteo Kutufa
Server listening only on [::]:5000
by Matteo Kutufa - Sunday, 26 November 2017, 2:38 PM
 

Hi Everybody,

I'm new and I've installed adapt on a public server following the instructions here: https://github.com/adaptlearning/adapt_authoring/wiki/Install-on-Server

After installation I'm not able to put server listening on public ip of VPS, every configuration let server available only on tcp6 localhost address.

This is the netstat -tap output:

tcp        0      0 localhost:27017         *:*                     LISTEN      6177/mongod
tcp        0      0 *:ssh                   *:*                     LISTEN      894/sshd
tcp        0      0 *:smtp                  *:*                     LISTEN      1095/master
tcp        0      0 localhost:45520         localhost:27017         ESTABLISHED 6388/node
tcp        0      0 medapt:ssh              2-236-34-9.ip231.:64371 ESTABLISHED 1299/0
tcp        0      0 localhost:45516         localhost:27017         ESTABLISHED 6388/node
tcp        0      0 localhost:27017         localhost:45516         ESTABLISHED 6177/mongod
tcp        0      0 localhost:27017         localhost:45519         ESTABLISHED 6177/mongod
tcp        0      0 localhost:45519         localhost:27017         ESTABLISHED 6388/node
tcp        0      0 localhost:27017         localhost:45517         ESTABLISHED 6177/mongod
tcp        0      0 localhost:45518         localhost:27017         ESTABLISHED 6388/node
tcp        0      0 localhost:27017         localhost:45520         ESTABLISHED 6177/mongod
tcp        0    464 medapt:ssh              2-236-34-9.ip231.:64532 ESTABLISHED 6403/1
tcp        0      0 localhost:45517         localhost:27017         ESTABLISHED 6388/node
tcp        0      0 localhost:27017         localhost:45518         ESTABLISHED 6177/mongod
tcp6       0      0 [::]:5000               [::]:*                  LISTEN      6388/node
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      894/sshd
tcp6       0      0 [::]:smtp               [::]:*                  LISTEN      1095/master

any idea/suggestion?

Thank you!

Matteo

Picture of Fabio Beoni
Re: Server listening only on [::]:5000
by Fabio Beoni - Thursday, 30 November 2017, 1:24 PM
 

Hi Matteo,

unfortunately the tutorial ends to the installation. To make the nodejs app available outside on Internet, may I suggest you to have a look to this GoDaddy tutorial? I think may be useful: https://it.godaddy.com/help/configurare-lapplicazione-di-nodejs-per-la-produzione-ubuntu-17352?lang=en

Refers to publishing a nodejs app on Ubuntu server using PM2 and NGINX, quite useful modules to do it.

Let me know! Thanks, Fabio.

Picture of Matteo Kutufa
Re: Server listening only on [::]:5000
by Matteo Kutufa - Tuesday, 5 December 2017, 3:12 PM
 

Thank you! Works!

Picture of Sam Tsiu
Re: Server listening only on [::]:5000
by Sam Tsiu - Thursday, 30 November 2017, 3:41 PM
 

Hi Matteo

If you're using Nginx server, then my Nginx config for the authoring tool app might be of help.

Put the following file with a name, such as builder in the /etc/nginx/sites-available/  directory with the following content. 

For https

server {
  listen 80;
  # here put your server url
  server_name adapt.example.com;

  # remove this line if you don't set ssl
  return 301 https://$server_name$request_uri;

}
server {
  listen 443 ssl;
  server_name adapt.example.com;

  # add Strict-Transport-Security to prevent man in the middle attacks
  add_header Strict-Transport-Security "max-age=31536000";

  # here use your own keys

  ssl_certificate /etc/nginx/ssl/214221800250787.pem;

  ssl_certificate_key /etc/nginx/ssl/214221800250787.key;

  ssl_session_timeout 60m;
  ssl_protocols SSLv2 SSLv3 TLSv1;
  ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  ssl_prefer_server_ciphers on;

  # if you don't use ssl, move this location part to the above server block

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:5000;
  }
}

For http only

server {
    listen 80;
    server_name adapt.example.com;

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:5000;
    }
}

then enable the config above. 

 

I use a Upstart script that helps automatically start or shutdown the adapt authoring tool with the system start or shutdown.

To create a configuration file for the authoring tool, do the following:

  • go into the /etc/init/ directory
  • then sudo vi builder.conf with the following content
description "Adapt Authoring Tool Platform"
author      "Sam Xu"
start on runlevel [2345]
stop on shutdown

respawn
respawn limit 99 5

script
    addtime=$(date +"%Y-%m-%d")
    cd /your_authoring_tool_installation_root/
    node server 2>&1 >> /your_logs_dir/adapt-builder.$addtime.log
end script

With this configuration, the Adapt Authoring Tool will start and shutdown with the system. However, you can stop the authoring tool with sudo stop builder or start the tool with sudo start builder and checkout the tool's log with a command such as

tail -f /your_logs_dir/adapt-builder.datetime-log

Hope it helps! Sam

Picture of Matteo Kutufa
Re: Server listening only on [::]:5000
by Matteo Kutufa - Tuesday, 5 December 2017, 3:12 PM
 

Thank you! Works!