Ced
Ced

Reputation: 711

How can I find where node.js is running?

I have a VPS with node.js installed, I already uploaded a basic example to test it on the server, so I tried doing this:

I access by SSH, navigate to my project folder and run

node app.js

I get this message

Express server listening on port 8080

I thought i could see my app here

example.com:8080 or server.example:8080... but nothing. Then I tried with the info from os.networkInterfaces(); and os.host(); and still nothing happen

could you help me out? as you can see I am a total noob on node.js. What I'm doing wrong? or what should I do before running my app? Something related to DNS's? i have no idea

Upvotes: 0

Views: 412

Answers (2)

Ced
Ced

Reputation: 711

if someone ever has the same problem this is how i solved on CentOS:

Open this file

 / Etc / csf / csf.conf

Add the required port

Allow incoming TCP ports

TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,26"

Allow outgoing TCP ports

TCP_OUT = "20,21,22,25,37,43,53,80,110,113,443,587,873"

Restart

 # # Csf-r

Upvotes: 0

gtsouk
gtsouk

Reputation: 5263

How do you ssh to your host? with ip or name? Is it something like:

ssh [email protected]

if so then at least you know your DNS is ok.

Once on the server do a

netstat -a

if you find *:8080 then your server is listening in the default ip. If you see something like 12.23.45.67:8080 then this number is the ip your server is listening.

ifconfig

will give you the servers ip. This should be the same as the ip of example.com. If not then maybe there is some router/firewall in front of your server and you have to configure that to allow port 8080 to reach your server.

Upvotes: 1

Related Questions