Search code examples
node.jsapachenpmserverpm2

Installing Node Application on a server. Apache npm pm2


I have installed a node js application (myapp.js) on a server with a particular IP.

I have npm installed and started the application

I have done this before but it was with apache and much more complex.

However this is the only application on this server. It is running fine.

Shouldn't this just be available at the ip it is installed on?

My own guess is it is something to do with the node setup within the applicationpm2 server, as its referring to a local host 8050? Maybe this needs to be an IP?

enter image description here


Edit I have just installed the application on the server. I havent set up any apache so maybe that is the issue. I think perhaps because i defined a port within the application it then needs a port specified on the server?


Solution

  • Your node application could be accessed locally from:

    http://localhost:8050/
    

    And from outside at:

    http://youripaddress:8050/
    

    Assuming that port 8050 is open, naturally.

    You can also setup a reverse proxy with apache or nginx (or anything else) to proxy your application.