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 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.

share|improve this question
3  
Normally everything you need to know to answer your question is included in the comments in Apache's config file. –  John Gardeniers 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

2 Answers 2

up vote 5 down vote accepted

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
share|improve this answer
    
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

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.

share|improve this answer

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.