I have a Windows Server 2008 R2 that I use to host various ASP.NET applications under IIS7. I would also like to run various PHP based web apps using Apache (or Apache 2). The server has three static IP addresses assigned to it and I would like to bind one of the IP addresses to Apache while using the other two IP addresses for IIS. I can use the IIS Manager to bind the specific IP addresses to IIS, but I am unaware of how to do this with Apache. Can anyone tell me how to go about binding Apache to a specific IP address and port (port 80 is what I want to use).

Please note .. I am aware that PHP can run under IIS. In fact that is how I have been running my PHP web applications. However, there are so many inconsistencies and pitfalls with PHP running under IIS that I just prefer to use Apache.

  • 3
    Normally everything you need to know to answer your question is included in the comments in Apache's config file. Dec 21 '10 at 21:41
  • Looks like you are correct. It really is well documented. Microsoft would do well to adopt this model.
    – webworm
    Dec 21 '10 at 21:59

It's in the apache documentation and also commented in the apache2.conf file



# Listen on all interfaces on port 80

# listen on port 80
  • I ran through the install process of Apache 2 but I got a console window saying that Apache could not bind to an IP address. I tried editing the httpd.conf file but when I tried to start Apache I got the same error. I shutdown IIS when doing the install.
    – webworm
    Dec 21 '10 at 22:30
  • if you have it running, close Skype, it uses port 80, don't ask me why. Apr 24 '17 at 17:53

Open httpd.conf under conf folder and The listen line should be edited so that it reads as

listen yourip:yourport

Then you would have apache2 listening on that port and that ip. netstat command should confirm this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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