blog:apache_redhat_6_make_sock_bug

Differences

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

Link to this comparison view

Next revision
Previous revision
blog:apache_redhat_6_make_sock_bug [2014/05/30 03:23] brettblog:apache_redhat_6_make_sock_bug [2014/05/30 03:54] (current) brett
Line 2: Line 2:
  
 This is a fucker of a defect that affected RedHat 6.3, 6.4, 6.5 - which I've verified.  Probably 6.0, 6.1, 6.2 and 6.3 as well. This is a fucker of a defect that affected RedHat 6.3, 6.4, 6.5 - which I've verified.  Probably 6.0, 6.1, 6.2 and 6.3 as well.
 +I found this: https://issues.apache.org/bugzilla/show_bug.cgi?id=45863 but it was of no help and was more of a red-herring than anything else.
  
 +<code>
 +# httpd -version
 +Server version: Apache/2.2.23 (Unix)
 +Server built:   Feb 13 2013 02:41:10
 +</code>
 +
 +Here is the output that you are confronted with
 <code> <code>
 [Thu Sep 19 14:11:13 2013] [warn] VirtualHost localhost:82 overlaps with VirtualHost localhost:82, the first has precedence, perhaps you need a NameVirtualHost directive [Thu Sep 19 14:11:13 2013] [warn] VirtualHost localhost:82 overlaps with VirtualHost localhost:82, the first has precedence, perhaps you need a NameVirtualHost directive
Line 11: Line 19:
 </code> </code>
  
-Doing an lsof on port 81 tells you nothing is listening.+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 and the strace doesn't give you much clue.+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 24: 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.  The trouble makers were found in /etc/hosts as follows
-The solution: simply stated 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
Line 37: Line 40:
 </code> </code>
 Once we had removed 'localhost' and 'localhost.localdomain' from the ::1 definition line, apache/httpd could start successfully. 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
 +
 +In my configuration I had this
 +<code>
 +Listen localhost:81
 +</code>
 +If I had change it to this it would have also made the problem go away.
 +<code>
 +Listen 127.0.0.1:81
 +</code>
  
 {{tag>apache}} {{tag>apache}}
  • blog/apache_redhat_6_make_sock_bug.1401420216.txt.gz
  • Last modified: 2014/05/30 03:23
  • by brett