The problem lies in the fact that ,by default, both Apache and IIS uses the same port 80 and so they are conflicting with each other.The solution of the problem is simple.You just need to change the port of either Apache or IIS, so that port 80 is occupied by only one of them.Here I am going to demonstrate you guys how to make IIS and Apache listen to port other than 80.
I am presuming you already installed Apache and IIS on your system and you are using them as local servers.Also this tutorial is tested on Windows 7 and 8 ,but it should also works fine on windows 2008 server.
Change the default port number for Apache Server:
If you want to change the default port number for Apache server, follow these steps:
- For this,you just need to make few changes in the httpd.conf file.
- Go to Apache installation directory, look for the folder conf and inside it find the file httpd.conf.I have installed Apache in C drive ,so the path to this file is C:\Apache2.2\conf\httpd.config.
- If you are installed WAMP Server then you can found this file by going to C:\wamp\bin\apache\conf\http.conf.
- Open this file with notepad and search for Listen 80. (by pressing ctrl+F)
- Change Listen 80 to Listen 8080 .You can also choose other number but 8080 is easy to remember.
- Next Find ServerName localhost:80 and change it to ServerName localhost:8080.That's it .Now restart your apache server and type in your browser localhost:8080 .You should see the apache Server page.
- As I am expecting that you have installed the IIS sever either in windows 7 or windows 8 ,just click start button and search for IIS.Windows 7 users can use the search option available under programs list.You will Find a program named Internet Information Services(IIS) Manager.Just click it to open it.
- On the left panel of the window click arrows to expand until you see the Default web site.Right click on it and select Edit Bindings.
- Here you can see that 80 is written under port.You need to change this.Highlight it by clicking on it and select edit.change 80 to 81 and click ok.
- Open up your browser and type localhost:81 and it should show you the IIS server page.Here are the screenshots.