Fabrice G's picture

Hi,

Maybe this topic got a previous answer, but i didn't find.

I have downloaded and worked on node.js appliance (thank turnkey, it's very powerfull).

For my application i need to build a web services server and i can change the client it must connected to tcp/80. The problem this port is already listening by default with the control panel (web shell & webmin redirection).

How can change this ?

Thank you for your help

 

Fabrice

Forum: 
Alon Swartz's picture

TurnKey NodeJS is setup so that nginx (the web server) proxies requests to localhost:8000, which is where your nodejs app should be listening. The nginx configuration is located at: /etc/nginx/include/nodejs-proxy

A custom initscript /etc/init.d/nodejs sources /etc/default/nodejs looking for NODEJS_EXEC, which is the nodejs app executable. By default, it's configured to start the TKL web control panel nodejs app, and is what you should change to serve your own nodejs app.

To summarize:

  • Stop the control panel nodejs app: /etc/init.d/nodejs stop
  • Edit /etc/default/nodejs so it points to your apps executable
  • Start the nodejs service: /etc/init.d/nodejs start
Fabrice G's picture

I'm in dev step so i don't want to define my app as service.

With your support, I finding and deleting lines on nodejs file in /etc/nginx/site-enabled/

server {
    listen 0.0.0.0:80;
    include /etc/nginx/include/nodejs-proxy;
}

Now I can dev ;-) When my app will be stable, i going to change this conf and comeback to more secure and stronger with using nginx.

Thank you !


Add new comment