Running IIS and Apache on the same Windows 2003 server

Posted by Dan on Oct 29, 2007 @ 6:46 PM

Today I was working on server and need to run Apache v2.2 and IIS6 on the same Windows 2003 server. Whenever I would try to start the Apache service with any Virtual Host and listener configured to port 80, it would give me an error like the following in the Windows Event Viewer:

The Apache service named reported the following error:
>>> (OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address 127.0.0.1:80 .

It was then followed up with another error message:

The Apache service named reported the following error:
>>> no listening sockets available, shutting down .

It turns out that IIS automatically listens to port 80 on all bound IP addresses. Microsoft's Support KB offers detailed instructions on setting up an IP inclusion list which will make IIS only listen to port 80 for the IP addresses you specify.

These steps involve installing the Windows Server 2003 Support Tools as you need the httpcfg.exe tool that comes in the package.

Once you've got the Support Tools installed, the steps are pretty easy:

  1. Click the "Start" button and go to the "Run" option.
  2. Type "cmd" and hit [ENTER].
  3. Type "cd \path\to\support tools\" and press [ENTER].
  4. NOTE:
    TIP: Remember you can press the [TAB] key to cycle through directory names once you start typing a path. This saves lots of typing.
  5. Type "httpcfg set iplisten -i xxx.xxx.xxx.xxx" and press [ENTER] (where xxx.xxx.xxx.xxx is the IP address to add to the inclusion list.)
  6. Repeat the above step for each IP address you want to add.
  7. Next, type "net stop http /y" and press [ENTER] to stop the HTTP service.
  8. Finally, type "net start w3svc" and press [ENTER] to restart IIS services.

Once you this is done, you should be able to configure Apache to listen on any IP address that's not in your inclusion list for IIS.

Categories: HTML/ColdFusion, Technology

5 Comments

  • Awesome work thanks - had me up n running in 5 mins :)
  • Thanks for posting this information - seems kinda counter intuitive that M$ would give you the option in IIS to bind to only one IP and then capture all the interfaces anyway!
  • Dan,

    Great article -- I have an issue now were we have some php code which really needs to run under Apache (all our existing is IIS). Do you think though, out of curiosity, that we could run ColdFusion8 on both webservers (Apache & IIS) from a single instance/install?

    Regards,
    Jeremy
  • @Jeremy:

    I have no idea if you can connect to multiple web server from the same CF instance. I've never had a reason to try it.
  • 1000s Thanks ! :)

    Im'm not use IIS ( for some reason..)-- i prefer Apache HTTP Server alone.
    But didnt started, and gave me hard times, on my work schedule.

    I thougth the Google Desktop Search the "problem" ( as i read some other blog..), but after (very hard) install the support tools on windows 7, now its works my apache 2.2 .

    God bless you! :)
    Jean

Add Comment

Leave this field empty