4

Why does connecting to xx.xx.xx.xx via browser give me a connection timeout?

New instance, RHEL 7. Fresh apache installation. Version 2.4.6

Port 80 is open and apache is listening

netstat -anp | grep 80
tcp6       0      0 :::80                   :::*                    LISTEN      5651/httpd

apache access logs are empty. Apace error logs are empty.

curl 127.0.0.1

Returns the page.

What else can cause this? Where else should I look? Never had the issue with 2.2.x

EDIT: After updating httpd.conf to use IPV4:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      10569/httpd

2 Answers 2

4

This is a networking issue, not an Apache issue. As you indicated, you can access the page using "curl" when run locally on the web server, but not from a browser on the desktop over the network. Check routing and firewalls between the desktop and the server.

You could try using nmap from your desktop to confirm if port 80 is accessible over the network, but not responding:

nmap -sS -O -p80 ip.of.your.server/32
2
  • 1
    Yup. I missed that curl actually returns the page. Commented Jan 15, 2016 at 20:08
  • 2
    iptables. Apparently -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT is not the same as -A INPUT -p tcp -m tcp --dport 80 -j accept
    – Kisaragi
    Commented Jan 15, 2016 at 20:15
4

tcp6 indicates ipv6 usage.

Either change the settings to use ipv4 by using:

Listen 0.0.0.0:80

And not

Listen 80

Or try curl localhost or curl ::1.

4
  • Thanks. I've changed the httpd.conf to use IPV4. Reloaded the service and the issue remains. Re added the iptables rule as well, same issue :/
    – Kisaragi
    Commented Jan 15, 2016 at 19:30
  • Can you update your question with netstat? Commented Jan 15, 2016 at 19:56
  • This saved my day - thanks for this!!!
    – Tom
    Commented Nov 23, 2020 at 14:40
  • glad it helped 💜 Commented Nov 23, 2020 at 23:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .