how to run nodejs app in vps with plesk enable - node.js

Hi guys im newbie in vps... I've bought an ovh not managed vps . I like to face problems... But I don't find any documents to these one. Is simple like I said I want to run a nodejs app in centos vps environment but I have enabled plesk.. and I saw in console running the app with the trace but I try to open website with the port and doesn't find anything.
http://vps406315.ovh.net
Thx for all guys
-----------------EDIT-------------------
I'm going to explain better,sorry for previous post.
There is no error, in my console all is ok. Like I said i have an CentOS VPS. Steps that I did:
Connect with PUTTY
Go to folder where is the NodeJS project.
I set the port to 8080
Write node index.js
The app is running and writing the right trace.
I use chrome to check the ip, and show me the default plesk page.
I use wget to check it, and with only http://92.222.71.137/. I attach
an screenshot
I tried to use with the port 8080 with the chrome and wget in putty,
and the response was the same.
In the other hand if I use http://92.222.71.137:8080/login with putty
download the right login.html, and the nodejs app write a trace
indicate me that someone connect to that page. But if I access with
chrome is not working.
Now I would like no know how to make access frome Chrome.
Thx 4 all and sorry for my newbie knowledge

You should give some other details on the configuration or eventual errors you get (both on the browser and the VPS) and how you run the node app (behind a web server, for example)
If you are not running you node app behind a web server, are the node app listening on the correct interface ? 127.0.0.1 and 92.222.71.137 (your site external address) are not the same.
On your VPS you can try to call the node app from the VPS itself using wget or cURL and looking for what happen in the app trace.

Finally it was easy... only i had to open a port to use with TCP, using
iptables -I INPUT -p tcp --dport 8856 --syn -j ACCEPT –

Related

Vue application running on Digitalocean times out in browser

First time I try to use a node.js droplet on Digitalocean: I have a vue.js application running on port 8080, but it times out when I try to load the masterpiece in the browser (I don't have a domain so I use the [server IP]:8080 to access it).
I made sure 8080 is open in the firewall (ufw):
Netstat -pln gave the result seen in the screenshot below, a node program is running but nothing is named vue in case that would be required:
Tried export HOST=0.0.0.0 on advice from a friend, but didn't seem to do anything.
Tested curl 127.0.0.1:8080 from the digitalocean console and it works correctly.
The browser error message is err _ connection timed out.
Any tips on how to get this to show in the browser? As I'm not experienced in working with servers please give me step by step instructions. Thanks!

Can't connect to Jekyll's localhost:4000 on Windows 10

I'm trying to set up Jekyll on my Windows 10 machine, but can't connect to the website (127.0.0.1:4000) that is created by jekyll serve (or bundle exec jekyll serve). I have followed all the steps in Julian Thilo's Run Jekyll on Windows without any error messages. And when I run jekyll serve in PowerShell from my Jekyll website folder everything seems just fine:
Configuration file: C:/Users/fredr/dropbox/github/jekyll-website/_config.yml
Source: C:/Users/fredr/dropbox/github/jekyll-website
Destination: C:/Users/fredr/dropbox/github/jekyll-website/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.457 seconds.
Auto-regeneration: enabled for 'C:/Users/fredr/dropbox/github/jekyll-website'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
But when I open http://127.0.0.1:4000 (or http://localhost:4000) in my browser, the connection fails.
When I run netstat -an, the port 4000 is listed as
Proto Local Address Foreign Address State
TCP 127.0.0.1:4000 0.0.0.0:0 LISTENING
I have previously managed to set up a localhost using IIS, but that website is stopped now.
This Github issue seems related, but doesn't contain enough information for me to figure out how the problem was solved. It only says to use the "Jekyll on windows package", but I can't find any information on that.
Following in #Fredrik P's footsteps, I CD'd into the project's _site folder (this is where the home folder of the server should be) and ran a Python 3.x simple HTTP server:
D:\frida\frida-website\_site>python -m http.server 3999
Serving HTTP on 0.0.0.0 port 3999 (http://0.0.0.0:3999/) ...
Now pointing my browser to http://0.0.0.0:3999/ works like a charm.
If you need to use Python 2.x, the HTTP server command would be:
python -m SimpleHTTPServer 3999
For more information regarding SimpleHTTPServer (2.x) and http.server (3.x), see this Stack Overflow post.
Until some better solution pops up, I will just host the _site folder with IIS. Not as fancy pancy but works like a charm :)

I can only access NodeJS server locally

My server's hosted at DigitalOcean (it's a droplet) and basically, I cannot access my NodeJS app via Internet, only server-side. It's running on port 9000, I've allowed traffic to the port via ufw and iptables, no luck. When I run curl || wget while SSH-ed to the server, I get a normal response as if everything's in order. But when I try to access the server from an another machine, I just get timed out because the server returns nothing. I've heard DigitalOcean sometimes disable connections to all ports except ssh,www and ssl, but I think I've successfully 'opened' them. Any suggestions?
This is what I get when I run netstat -tulp | grep LISTEN
Turns out my dashboard was all messed up when it comes to ports, which I forgot to check, of course, so opening them directly on the server gave no results whatsoever.

How can I access my nodejs web server from my local computer using the server domain name?

I installed nodejs and created a sample app. When I run npm start I get a message saying that I can open my web browser to http://localhost:3000 to see the app in action, but this installation is on a web server - not my local computer, so, instead of localhost:3000 I want to get there using something like mydomain.com:3000
I can't find the answer, it's very likely I just don't know how to search for it... any ideas?
I'm following the tutorial here: https://facebook.github.io/react/tutorial/tutorial.html
I think I only needed to get away from this for a while. I got it working using ssh local forwarding.
I already used an ssh config file to log in to my server without having to remember the password, so I just added this line to my config file:
LocalForward localhost:3000 xxx.xxx.xxx.xxx:3000
where xxx.xxx.xxx.xxx is my server IP address.
Then, I connected to my server via ssh:
ssh -f -N mysite
Once connected, I open up the browser and go to localhost:3000 and there it is now.
I used my ssh config file, but it should also work without it.
ssh -f -N -R 3000:localhost:3000 mydomain.com
I found this command that eventually led me to solve my problem in this link: http://stuff-things.net/2016/01/20/tunneling-to-localhost/

Running nodejs app on Centos7 apache server

I'm trying to run a node web app (built with meteor) on a Centos7 server running EasyApache4 with WHM cPanel. I'm trying to run it on a subdomain off of one of our main websites on port 8080.
When going to the subdomain on port 8080, the connection just times out, but can see the html when using curl to access it.
Does anyone have any ideas why it won't work through the browser, and also how I can get it to look like it's running straight from the subdomain instead of having to go directly to the port.
EDIT
Below is the curl we are using to view the html
curl http://subdomain.site.com:8080
Doing that brings back the html no problems
Had the same problem today. I am using Memset Centos7 server with WHM/CPanel, running EasyApache 4.
After trying everything I could think of, I realised that I had a basic firewall setup, which closed all ports that were not listed. After adding port 8080, it worked.
Used this:
sudo iptables -I INPUT 1 -i + -p tcp --dport 8080 -j ACCEPT
I am not 100% certain how secure this is, as I am still researching.

Resources