I have googled around a lot. I may not have googled the right keywords, if this question has been answered somewhere else, please link me to the question.
The Problem
I have a simple node web server I wrote and I want to be able to access the files from anywhere not in my home.
If I connect to localhost, it works fine and gives me the file I want
But if I were to connect to my computer's IP, it does not connect
I assume it is something to do with my firewall, but I added a rule to allow connections from port 80.
The Question
What is causing this, and how do I fix it
any help would be greatly appreciated
I have found the answer.
It was nothing to do with port forwarding, everything to do with my node application.
I had it listen on localhost only, which blocked the other ips
Related
I have a server running centos 7 using cpanel and whm with csf. I am trying to run a nodejs express application on it that listens on port 3000. In order to do so, I added the line tcp|in|d=3000|s=0.0.0.0 to csf.allow.
When I run the code and use wget localhost:3000, I get the html files as expected, but if I try to connect from a browser the server just doesn't get the request. Am I doingsomehting wrong?
I am new to Linux and server management, so sorry in advance if I didn't give enough information. I'll be happy to provide more if needed.
If anyone stumbles upon this from Google, the problem was that my server provider was blocking uncommon ports. I mailed them and after two minutes the problem was solved.
I followed all kinds of instructions all day to get my first server up and running. I tested it on 3 devices and thought I had it... until my friend tried it and discovered "site can't be reached."
In double-checking on my end, I found that if I disconnected my phone from wi-fi, sure enough, I couldn't reach my server.
I realize there could be a million things wrong, but I don't know where to start. I am not even sure what additional information I should include to help find the issue. If I had to guess, I'd say I failed to open the firewall on my server port 80. But I really have no clue. Ubuntu is new to me.
Can you include details about your setup? How is the Ubuntu server configured? If it's your own hardware, have you forwarded the ports on your router? Do you have a Dynamic DNS server in place? Is there an internal firewall (ufw?). Is the Node.js server bound to the loopback? Is Nginx in proxy_pass mode?
As mentioned by the OP, the ports weren't forwarded.
Not sure if this is for programming only but I will ask anyway. I have an Arris DG1670A router and am trying to setup remote access. I do not have a tab or a section that enables remote access like some routers do. I have tried setting up Virtual Server / Port Forwarding and port triggers which is the closest setting I have seen in my router setting to remote access but when I check if the port I set up is open on canyouseeme.org is shows that the ports are closed.
Can someone provide some direction please.
If I am posting in the wrong place, please advice where to post.
Thank you
You have to enable firewall on that model for Port Fordwarding to work.
Default ports are TCP/UDP 3389.
I disable the internet connection and run the node server npm start, then it throws the error:
And now enabling internet connection and running the server works fine:
So, I want to confirm if this really needs to be connected to the internet while starting the server?
If it really needs internet connection, then is there any idea to run the server offline?
If I connect to the internet and run the server and there after plug out the internet connection then there's nothing goes wrong. Everything works fine. I don't know why just running the server requires the internet connection.
OMG! It's really cool! I got it working offline after hard research in my code using 127.0.0.1 instead of localhost for mongo uri.
Using localhost needed for me to connect to the internet.
And using 127.0.0.1 worked in both condition i.e. with internet connection and without internet connection.
But, really I'm totally amazed of this.
I found the really cool topic on this which made me clear about this.
If you use 127.0.0.1, then (intelligent) software will just turn that directly into an IP address and use it.
And there's no guarantee that your hosts file will actually be used for that resolution (first, or at all) so localhost may become a totally different IP address.
This is probably on the wrong site, so go ahead and move it if you have to... but I have been getting this same problem for the past week and it's really starting to irritate me. When I try to join my friend's MC server, I get an error saying "Disconnected Took too long to login." I googled the error and found that it could possibly be because the minecraft member authentication servers are down, but I eliminated that possibility by having my friend login to my account. It worked fine for him with the same server.
I also thought that maybe my minecraft client wasn't up to date with the server, so I tried updating my client with the update that the server used(12w07a) but that didn't change anything.
Then, I tried the idea to port forward my router to 25565, but that didn't do anything. My friend said sometimes ISP's(mine is verizon fios) block certain ports from being forwarded. If that's the case, is there any way of getting around it?
So I am not sure what exactly is causing the problem. Anybody have any ideas?
If your connection worked fine before this past week, it wouldn't make sense that Verizon is suddenly blocking certain ports. More than likely, there are some odd network settings floating around in your computer. If you're not sure if port 25565 is the correct port to forward, you can Enable DMZ (if your router supports it), which is basically forwarding ALL your ports (be sure to set it to your correct LAN IP, which can be found by command-prompting 'ipconfig'). If you have no software firewalls turned on, and you have enabled DMZ, there really shouldn't be any more networking issues...