3

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.

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

2 Answers 2

5

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
2
  • 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, 2010 at 22:30
  • if you have it running, close Skype, it uses port 80, don't ask me why. Apr 24, 2017 at 17:53
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .