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.
Related
I was requested to create a Web Server with an API in it to test firewall rule we are planning to implement soon. I am quite new with all this network stuff, so I'm a bit lost on it.
I need to call this API from another machine. The JsonServer is using my port 3000, when I request my API through Postman, using https://localhost:3000/posts, my JSON file is returned normally, however when I change the localhost, to my IP, my connection is being refused. I decided to install a WebServer, to test it and I could access the default Apache page from my others machines. I opened the port 3000 on my server, but I couldn't. The WebServer is working with my IP as well. It seems to be something with my port 3000, and I a not sure about how to fix that.
I executed the command:
sudo lsof -i -P -n | grep 3000
And this was my output
node 29472 user 22u IPv4 254348 0t0 TCP 127.0.0.1:3000 (LISTEN)
Any ideas how can I access my API from another machine?
Hello I am definitely new to HTTPS so please bear with me. In order to run the nodejs application, http-server, I use this command on my webserver:
http-server -p 80 -S
The -p flag specifies the port and then the -S flag specifies that I will be using the https protocol. I am able to access the website just fine by physically going to the web server's address like:
https://123.456.78.90:80
However when I try to access the site from my domain:
example.com
or even:
https://example.com
I get a connection refused error in the browser. This perplexes me as I have created A records to redirect the domain to the ip address with digital ocean, along with using their nameservers. This whole process works flawlessly when I start up an instance of http-server in normal http mode like this:
http-server -p 80
Any help is MUCH appreciated as I haven't been able to find much on the topic. Thanks internet people.
Try to use a free ports. The port 80 is currently used for http connections.
http-server -p 9090
Wow figured it out. I needed to specify the port 443 when starting the http-server for https to work properly.
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.
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 –
I have a node app already deployed on ec2 that redirects port 80 to 3000 using:
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
Now I want to add a Wordpress blog in a subfolder mydomain.com/blog.
Must I use apache's ProxyPass as explained here? Won't it slow down node.js?
The example in the link also seems to be more suitable for cases where one wants to add node to apache and not the other way around..because of the URL distinction (/node) and port 8000, or it can fit both cases?
Is there any other way to allow node and apache work on the same server? Also, how should the ports be managed?
I would suggest that you re-think your server architecture a bit. Here is what I would recommend.
Use Nginx server since its lightweight, free, and can run both PHP and NodeJS applications.
You will need to install Nginx's PHP module to make the PHP code work and you can also setup Nginx to proxy requests to your NodeJS application.
All this can be achieved by simply installing Nginx and configuring it using the many guides available online.
Updated on March 11, 2015
Here are the links to get these set up:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontab