I know that this question has been asked before, I've looked at a couple of them too, but for some reason I can't get my server to work.

What I'm trying to do is get access to my website through internet. When I try local (192.168...) it loads and everything is fine.

But when connecting from outside I get IP refused connection.

Few things:

I'm connected directly to the router, nothing in between. I do have port forwarding set up. I'm using port 80. My Ports.conf are set up properly, listening to the port 80 My 000-default.conf is also set up as it should.

What am I missing? On my last machine I got it working in no time, but it seems like I'm missing something here...?

  • Do you have ufw or another firewall running? – Organic Marble Jun 11 '16 at 23:26
  • I have it running, yes – IronCanTaco Jun 12 '16 at 15:52
  • Quick test - turn it off and see if you can access the website. If it works, you have found the culprit. Then open up port 80 and turn ufw back on. – Organic Marble Jun 12 '16 at 15:56
  • firewall was disabled, nothing changed – IronCanTaco Jun 12 '16 at 15:58

Try this

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

And ofcourse need to save the rules. Iptables-persistent is nice tool for this:

sudo apt-get install iptables-persistent

After it's installed, you can save/reload iptables rules anytime:

sudo /etc/init.d/iptables-persistent save 
sudo /etc/init.d/iptables-persistent reload

How to configure apache and iptables to allow incoming connections ubuntu server?

  • sorry, but it's still not working. – IronCanTaco Jun 12 '16 at 15:59
  • Connection refused still means that something is blocking the route. Maybe you have missconfigured port forwarding. From the outside you could also trace the packets with Wireshark, maybe will get something more informational – Taavi Jun 12 '16 at 17:32
  • I know that something is, but I really have no idea what it might be. I just tried running my server on another network, it works like it should. So it's definitely the router on that other network. Thanks for the help though ... :) – IronCanTaco Jun 12 '16 at 20:39
  • So in conclusion you replaced the router? :) – Taavi Jun 13 '16 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.