Apache2 does not run on IPv4 tcp port

The fact that netstat shows only tcp6 here is not the problem. If you don't specify an address to listen on, apache will listen on all supported address families using a single socket (for design reasons, sshd uses a unique socket per address & address family, hence showing up twice in your netstat output).

Here's one of my systems, showing apache having only tcp6 sockets, and yet still working fine via both IPv4 and IPv6.

woodpecker ~ # netstat -anp |grep apache
tcp6       0      0 :::80    :::*       LISTEN      1637/apache2        
tcp6       0      0 :::443   :::*       LISTEN      1637/apache2        
woodpecker ~ # wget http://127.0.0.1/ -O /dev/null
--2013-12-25 08:52:38--  http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45 [text/html]
...
# wget http://[::1]/ -O /dev/null
--2013-12-25 08:53:00--  http://[::1]/
Connecting to [::1]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45 [text/html]
...

If you run wget http://127.0.0.1/ -O - on the server what happens? Does it successfully connect? Does it return the raw HTML for your website as expected?


This will handle IPV4 connections only:

Listen 0.0.0.0:80
Listen 192.0.2.1:80 

https://httpd.apache.org/docs/2.2/bind.html#ipv6