Apache won't listen on IPv6

Started by Dahan, July 09, 2014, 06:55:50 PM

Previous topic - Next topic

Dahan

I'm running the Apache Haus 2.4.9 VC11 x64 build on Windows 7 (SP1), and it's not listening on IPv6 by default (e.g., with a "Listen 80" line in httpd.conf).

If I try to explicitly listen on an IPv6 address, e.g., by replacing the "Listen 80" with "Listen [2001:470:1f0f:17a:b875:823f:da32:6574]:80", Apache won't start, and httpd -t reports:

[Wed Jul 09 11:46:47.024907 2014] [core:crit] [pid 5040:tid 384] (OS 11004)The requested name is valid, but no data of the requested type was found.  : AH00077: alloc_listener: failed to set up sockaddr for [2001:470:1f0f:17a:b875:823f:da32:6574]
AH00526: Syntax error on line 60 of C:/Program Files/Apache24/conf/httpd.conf:
Listen setup failed

A previous version of Apache worked fine with the same config--I don't remember exactly which version it was, but it was something like 2.4.7 VC9 x86.

Gregg

Unfortunately I cannot duplicate since I do not have an IPv6 address exposed to the world. But, what happens with

Listen [::1]:80
or
Listen [fe80::6131:1627:9b11:1508]:80 <- IP being that of your NIC

With just Listen 80 (and no ServerName set) the server is binding to my NIC IP on Win7 Pro.
[Wed Jul 09 11:00:56.925386 2014] [mpm_winnt:notice] [pid 2124:tid 384] AH00455: Apache/2.4.9 (Win64) mod_geoip/1.2.9 configured -- resuming normal operations
[Wed Jul 09 11:00:56.925386 2014] [mpm_winnt:notice] [pid 2124:tid 384] AH00456: Apache Haus VC11 Server built: Jun  6 2014 21:08:46
[Wed Jul 09 11:00:56.925386 2014] [core:notice] [pid 2124:tid 384] AH00094: Command line: 'httpd -d C:/Apache24ah64'
[Wed Jul 09 11:00:57.018987 2014] [mpm_winnt:notice] [pid 2124:tid 384] AH00418: Parent: Created child process 2896
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::6131:1627:9b11:1508. Set the 'ServerName' directive globally to suppress this message

Dahan

Same error with Listen [::1]:80:

[Wed Jul 09 14:37:34.589993 2014] [core:crit] [pid 3680:tid 304] (OS 11004)The requested name is valid, but no data of the requested type was found.  : AH00077: alloc_listener: failed to set up sockaddr for [::1]
AH00526: Syntax error on line 61 of C:/Program Files/Apache24/conf/httpd.conf:
Listen setup failed

This time, I tested on a Windows 7 x64 virtual machine, Visual C++ Redistributable for Visual Studio 2012 Update 4, and a fresh install of httpd-2.4.9-x64-vc11.zip. The only change I made was to Define SRVROOT "C:/Program Files/Apache24" in httpd.conf. netstat -an | findstr ":80" only shows Apache listening on 0.0.0.0:80, not [::]:80. And when I changed the "Listen", I got the error shown above.

BTW, it looks like the build I'm running isn't the same as yours. When starting httpd, it says:

[Wed Jul 09 14:36:19.646275 2014] [mpm_winnt:notice] [pid 4076:tid 160] AH00455: Apache/2.4.9 (Win64) OpenSSL/1.0.1f configured -- resuming normal operations
[Wed Jul 09 14:36:19.647277 2014] [mpm_winnt:notice] [pid 4076:tid 160] AH00456: Server built: Mar 13 2014 14:33:55

Whereas yours mentions "Apache Haus VC11", and was built more recently.

Gregg

Confirmed.

I could tell as soon as I looked in include\apr.h

I'll have -R2 package for at least the VC11 x64 as soon as possible.
I am very surprised no one has run into this till now. Evidently not much IPv6 out there yet.
I lost the VM I had built those binaries on so yes I was using the rebuild I did for OpenSSL 1.0.1h.

Thanks for reporting this! I'll post again once I have the new binaries on the download page.

Gregg

Ok, the -r2 packages of 2.4.9 VC11 are up on the download page. They include the current OpenSSL (1.0.1h).

I should do the VC9 packages too, but the push is on to get 2.4.10 source released in the next week or two so I'm not going to bother with the VC9 packages.

Dahan

IPv6 works with the -r2 package. Thanks! :)