Php – How to bind Apache to specific IP and port on Windows Server 2008

apache-2.2PHPwindows-server-2008

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.

Best Answer

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

http://httpd.apache.org/docs/2.0/bind.html

e.g.

# Listen on all interfaces on port 80
Listen 0.0.0.0:80  

# listen on 192.170.2.1 port 80
Listen 192.170.2.1:80