I'm just playing with apache and i got it to work, that is i can connect to server by browsing to http://127.0.0.1
and http://192.168.1.5
i'm NOT running IPv6
Yet this is the result of netstat
$ sudo service apache2 status
* apache2 is running
$ netstat -an | grep :80
tcp6 0 0 :::80 :::* LISTEN
$ wget 127.0.0.1
--2014-06-26 01:32:15-- http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11510 (11K) [text/html]
Saving to: ‘index.html’
100%[=====================================================================================================>] 11,510 --.-K/s in 0s
2014-06-26 01:32:15 (161 MB/s) - ‘index.html’ saved [11510/11510]
I was expecting to see it listening on a regular TCP which it clearly does!?
Edit:
$ netstat -a | grep LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:mysql *:* LISTEN
tcp6 0 0 ip6-localhost:ipp [::]:* LISTEN
tcp6 0 0 [::]:https [::]:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
Edit2:
Why the down vote? What am i missing can someone elaborate?
Best Answer
TL;DR
Apache does appear in your
netstat
output, and it is running. That's why yourwget
call works. However, it's bound to your IPv6 address instead of your IPv4 one. Address mapping handles the translation when necessary.Going for the docs
There's obviously some IPv6-IPv4 fallback mechanism here. As a matter of fact, I don't use IPv6 on my local network, yet :
It is important to note that no matter how you address your machine, it's still the same service and port in the end. The rest is mainly up to your browser and DNS resolution services. However, for more information on how Apache handles this, you may want to have a look at their documentation :
Basically, this is about handling both IPv4 and IPv6 sockets in way that will avoid most problems related to cross-platform compatibility and socket handling. As you can read, on Linux platforms like Ubuntu, this problem is solved using IPv4-mapped IPv6 addresses. The documentation also states :
Which would give something like this in the
ports.conf
file :Resulting in one of the following
netstat
outputs...A beautiful, yet IPv6-not-ready, listener. The above setting is usually set in
/etc/apache2/ports.conf
(or directly inapache2.conf
for older versions). The default value isListen 80
, which performs an automatic binding, i.e. conforming to the IPv6 specifications given in the documentation.