Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to start an instance of Apache 2.2 server with a fairly-close-to-standard configuration file. I made one small change because I want Apache to serve a single XML file separately from everything else it does, purely for testing on my local machine. The change is that I inserted this into httpd.conf:

# Based on http://httpd.apache.org/docs/2.2/vhosts/examples.html

Listen 10.11.12.13:85

NameVirtualHost 10.11.12.13:85

<VirtualHost 10.11.12.13:85>
DocumentRoot "C:\foo\bar"
ServerName www.MyCompanyMyProjectFooBarTestURL.com
</VirtualHost>

Attempting to start Apache resulted in this:

(OS 10049)The requested address is not valid in its context. : make_sock: could not bind to address 10.11.12.13:85
no listening sockets available, shutting down
Unable to open logs

No instances of Apache are running. Nothing is using port 85 (or 80 or 8080). There's nothing special about 10.11.12.13:85; I just figured that was an IP that wouldn't interfere with anything.

What does this error mean, and how can I resolve it?

share|improve this question

3 Answers 3

Make sure that the IP is configured on an network interface that is UP.

To add an IP to a network interface on Windows 7 you can follow the HOWTO from http://www.pctips3000.com/how-to-assign-more-than-one-ip-address-to-one-lan-in-windows-7/

If you have DHCP, then you might need to do some Registry tricks like: http://www.petri.co.il/configure_tcp_ip_to_use_dhcp_and_a_static_ip_address_at_the_same_time.htm or just use static IP allocation.

share|improve this answer
    
Could you elaborate? I don't understand this. (If it's not obvious, this is my first time trying to do anything with Apache.) –  Pops Sep 21 '11 at 20:00
    
@LordTorgamus Is that IP address configured on the system, not just in Apache? Apache can't bind to a port on an IP that the system doesn't have configured anywhere. –  Shane Madden Sep 21 '11 at 20:30
    
Hm, no. I didn't realize I'd need to configure it elsewhere just to use it locally. Could you give me a search term to start with? I'm getting a lot of "set up your home router!" results in Google at the moment. @ShaneMadden –  Pops Sep 21 '11 at 20:41

There could be reason the IP address you are pointing is generic one. For example:-10.1.1.233:443 And you get error >>> (OS 10049)The requested address is not valid in its context. : make_sock: could not bind to address 10.1.1.233:443

comment the line in httpd-ssl.conf and start the Apache

share|improve this answer

In order to find a socket to bind to you can point to the local machine address. That seems to change when you turn the computer off and on. To find the local address in use, go into control panel, network and sharing center, click on the wireless connection, then on the "details" button, and the IPv4 address should be the local machine address. You can add this address and a good socket like 8088 to httpd.conf as a "Listen" parameter - e.g. Listen 127.0.0.1:8088 (that is a default localhost but your IP will be different) - you can list more than one of these addresses and it will bind to one that is free. This works in windows. Then add the same IP address to the hosts file.

share|improve this answer
    
Correction - the hosts file only needs the localhost IP address of 127.0.0.1 Also, the system will try to bind to the first IP listed under "Listen" and if it does not work the system will not bind and will display an error and close apache. I'm not sure if this is the best way do do things, but I'm just listing whatever address the system is using based on the IPv4 address ... which means you have to change the httpd.conf file whenever that address changes. –  user252558 Nov 5 at 23:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.