PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 15, 2022

[FIXED] How to open port 80 for node server on local machine?

 July 15, 2022     linux, networking, web-deployment     No comments   

Issue

How can I use the port 80 on my local Linux machine as the port of my node server?

The netstat command netstat -ptuln says the following about this port, while the node server is running:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      -                  

I found on this site some recommendations for the command sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT. I executed this command but when I make a request with curl (curl 1.97.xxx.xxx.xx) it keeps responding with curl: (7) Failed to connect to xxxxxx port 80: Connection refused.

But using curl the following ways works: curl 0.0.0.0:80 or curl localhost:80.

My conclusion is, that I somehow have not opened the port correctly, but all I could find on the internet repetitively is the command I mentioned earlier.

I am aware of the fact that I could fix this easily by using an apache server, but I would like to make it without it.

Thank you!


Solution

Paste the output from

netstat -ptuln

command.I think the problem is that your web server runs on local address and can not be reachable for other machines in network.



Answered By - Harut
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing