Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
blog:apache_redhat_6_make_sock_bug [2014/05/30 03:50]
brett
blog:apache_redhat_6_make_sock_bug [2014/05/30 03:54] (current)
brett
Line 21: Line 21:
 Doing an lsof, netstat, telnet or anything else you can think of on port 81 tells you nothing is listening. ​ OK so why the error message ! Doing an lsof, netstat, telnet or anything else you can think of on port 81 tells you nothing is listening. ​ OK so why the error message !
  
-Apache throws this in the STRACE saying it can't startup.  ​The strace is telling its trying to bind TWICE to the same port ! WTF.+The strace is telling its trying to bind TWICE to the same port!  WTF.
 <​code>​ <​code>​
 32709 setsockopt(3,​ SOL_SOCKET, SO_REUSEADDR,​ [1], 4) = 0 32709 setsockopt(3,​ SOL_SOCKET, SO_REUSEADDR,​ [1], 4) = 0
Line 32: Line 32:
 32709 setsockopt(4,​ SOL_TCP, TCP_NODELAY,​ [1], 4) = 0 32709 setsockopt(4,​ SOL_TCP, TCP_NODELAY,​ [1], 4) = 0
 32709 bind(4, {sa_family=AF_INET,​ sin_port=htons(81),​ sin_addr=inet_addr("​127.0.0.1"​)},​ 16) = -1 EADDRINUSE (Address already in use) 32709 bind(4, {sa_family=AF_INET,​ sin_port=htons(81),​ sin_addr=inet_addr("​127.0.0.1"​)},​ 16) = -1 EADDRINUSE (Address already in use)
-32709 write(2, ""​...,​ 78)               = 78 
-32709 close(4) ​                         = 0 
-32709 write(2, ""​...,​ 46)               = 46 
-32709 write(2, ""​...,​ 20)               = 20 
 </​code>​ </​code>​
  
-The solution: simply stated the trouble makers were found in /etc/hosts as follows+The solution.  The trouble makers were found in /etc/hosts as follows
 <​code>​ <​code>​
 127.0.0.1 ​  ​localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 ​  ​localhost localhost.localdomain localhost4 localhost4.localdomain4
 ::1         ​localhost localhost.localdomain localhost6 localhost6.localdomain6 ::1         ​localhost localhost.localdomain localhost6 localhost6.localdomain6
 </​code>​ </​code>​
-Once we had removed '​localhost'​ and '​localhost.localdomain'​ from the ::1 definition line, apache/​httpd could start successfully.  It boils down to being some sort of IPV6 issue.+Once we had removed '​localhost'​ and '​localhost.localdomain'​ from the ::1 definition line, apache/​httpd could start successfully.
  
 UPDATE: In light of https://​issues.apache.org/​bugzilla/​show_bug.cgi?​id=52884 UPDATE: In light of https://​issues.apache.org/​bugzilla/​show_bug.cgi?​id=52884
Line 51: Line 47:
 Listen localhost:​81 Listen localhost:​81
 </​code>​ </​code>​
-So I change it to this+If had change it to this it would have also made the problem go away.
 <​code>​ <​code>​
 Listen 127.0.0.1:​81 Listen 127.0.0.1:​81
 </​code>​ </​code>​
-And the problem also went away -- very curious indeed. 
  
 {{tag>​apache}} {{tag>​apache}}