Apache & IIS Multiple Address on Port 80

In: General

17 Oct 2005

Whilst developing with Apache, and IIS over a number of years, I have always found it frustrating to have to type and use a seperate port for the different web servers as you cannot bind to an IP Address with a single port, such as port 80. If you have tried to add multiple IPs, and bind to them, you may hav noticed this fail. This is due to a very simple configuration in IIS.

To Add multiple IP address’s, right click on your network adapter and click properties.

Enter the DNS information from your ISP, the default gateway, subnet, and your IP address.

Add an IP address, higher IP address than is required by DHCP such as 100+.

Open the command line, and run the following.

cd C:InetpubAdminScripts

This disables IIS from listening to the default IP address and run .


Select the Default Web Site, and right click opening properties.
Set the IP Address to an IP that is free and does not already have a server listening on port 80. Clicking Advanced you can bind IIS to a number of IPs or Host headers (Domains [www.ajohnstone.com], leaving the host header blank sets it as the default address).>

Now open httpd.conf

Modify the line.
“Listen 80″ to “Listen″ with the IP address you wish to bind it to.
Also update the “NameVirtualHost *:80″ in the same fashion to “NameVirtualHost″

Now open the hosts file. (C:\WINDOWS\system32\drivers\etc\hosts)          localhost       IIS      Apache

now restart apache and your set.


For more configurations on Apache on windows…

Comment Form

About this blog

I have been a developer for roughly 10 years and have worked with an extensive range of technologies. Whilst working for relatively small companies, I have worked with all aspects of the development life cycle, which has given me a broad and in-depth experience.