This article will help you to you to configure Apache and Internet Information Server(IIS), so that you can run each of these simultaneously on same Windows PC.I am a beginner in IIS and .NET and trying to learn application development in ASP.NET.I have already Apache server running on my system on port 80 and now I also installed IIS on my system.Whenever I type localhost in my browser the Apache server page show up but the IIS server page is nowhere. 
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.2confhttpd.config.
  •  If you are installed WAMP Server then you can found this file by going toC:wampbinapacheconfhttp.conf.
  • Open this file with notepad and search for Listen 80. (by pressing ctrl+F)
changing port number in apache
  • 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.
apache port number change
                               Before Making changes  
apache port number change
                           After changing the port to 8080
Change the default port number for IIS Server:
The default port number for IIS server is also 80 but you can easily change it.Here it is explained in simple steps.
  • 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 theDefault web site.Right click on it and select Edit Bindings.
changing port number in IIS
  • 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.
changing port number in IIS
  • Restart the IIS server by clicking Restart on the right panel.
restarting the IIS
  • Open up your browser and type localhost:81 and it should show you the IIS server page.Here are the screenshots.
IIS
                     Before making changes
 
IIS
                   After changing port to 81
 
You need to change the port number only one of them in order to work them together on the same PC.Want to suggest an Improvement? Use the comment box below.