You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2009/01/29 20:38:52 UTC

DO NOT REPLY [Bug 46630] New: httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

https://issues.apache.org/bugzilla/show_bug.cgi?id=46630

           Summary: httpd wont start if there are two (or more) exactly same
                    host entries in the hostfile and the Listen directive
                    has hostname in addtion to port
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: skeswani12@gmail.com


Server version: Apache/2.2.6 (Win32)
Compiled using: APR 1.2.11, APR-Util 1.2.10
Architecture:   32-bit
Server MPM:     WinNT

# httpd.com
LISTEN myhost:80

#/etc/hosts
# there are two exact same entries in the host file
138.42.223.12 myhost
138.42.223.12 myhost1 

# the reason we use this pattern is to enable us to listen on IPv6 addresses in
addtion to Ipv4 address

#Httpd fails to start with following error 
The Apache service named  reported the following error:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted.  : make_sock: could not bind to address 138.42.218.137:80     .

#expected, httpd should check if it is already listening on IP:port, if so any
subsequent attempts to listen on the same IP and port are no-ops


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630


Will Rowe <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #2 from Will Rowe <wr...@apache.org>  2009-01-29 11:43:56 PST ---
Refer to the syntax of the Listen directive.

Using domain names in the Listen directive is a convenience, but not an excuse
to ignore the rule of having one and only one Listen directive per IP/Port.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630


Sumeet Keswani <sk...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows XP                  |Windows Server 2003




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630





--- Comment #5 from Sumeet Keswani <sk...@gmail.com>  2009-01-29 15:23:58 PST ---
1. there is no dns lookup involved here. this is the /etc/host file and the
machine is querying its own hostname.
2. surely i am better off using IP addresses. as i said there are workaround
for sure. (in my case that is not a option available to me)
3. however that does not take away from the fact that httpd is trying to bind
to a socket it has already acquired. i have only uncovered one manifestation of
this issue - hopefully the only one.
(think of this as trying to call open on file that you already have opened -
obviously that would be a error condition).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630





--- Comment #4 from Will Rowe <wr...@apache.org>  2009-01-29 12:12:26 PST ---
It's not httpd's job to fix your config file.  And there are legitimate
reasons not to cause DNS lookups at startup (and especially while the server
is processing requests).  You are better off using IP addresses rather than
domain names where applicable to ensure the server can start even when DNS
isn't ready to process lookups.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630


Sumeet Keswani <sk...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows XP                  |Windows Server 2003




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630





--- Comment #3 from Sumeet Keswani <sk...@gmail.com>  2009-01-29 11:55:57 PST ---
there is a legitimate use case to use hostname
1. suppose you have machine with nultiple IP address
2. what if there is Ipv6 and Ipv4
3. finally for dhcp based systems the IP address may change sometimes, in which
case hostname is the only options.

obviously, all of the above have workarounds. but that does not detract from
the issue that the http daemon should not attempt to bind to a socket that it
has already acquired


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46630] httpd wont start if there are two (or more) exactly same host entries in the hostfile and the Listen directive has hostname in addtion to port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46630


Sumeet Keswani <sk...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows Server 2003         |Windows XP




--- Comment #1 from Sumeet Keswani <sk...@gmail.com>  2009-01-29 11:41:45 PST ---
sorry error on my part, host file should have exact same entry two or more
times
(the lines should read as follows)
#/etc/hosts
# there are two exact same entries in the host file
138.42.223.12 myhost
138.42.223.12 myhost


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org