Run IIS and Apache webserver on same machine on same port (80)

I am a non-pro web developing :D. But I love programming very much !

From 2003 to 2007, I used PHP as a primary web language. From the end of 2008 to now, I try to use ASP.NET (C# language). So that, I have a lot of time to “struggled” against with Apache and IIS. That ’s so great.

A few month ago, I have a problem that : I need to run same IIS and Apache on the same server at same port 80. Before, I done when tried to config them run at same computer on other port 80 and 8080. Is that difficult ?

So lucky, Google helped me resolve that. And now I want to write down it like a note :D

In assume, we have a server runing Windows Server 2008 Standard, it have two IPs address : 192.168.0.100 and 192.168.0.200 (Please note : We need at least 2 IPs address for this lab !) and 2 test domain name : forum.microsync.net and blog.microsync.net. Our target : IIS7 will be run on 192.168.0.100, hosted forum and Apache will be run on 192.168.0.200 and hosted blog. That ’s very easy !! {smile}

Now, setup IIS first and add domain forum.microsync.net for it. Open web browser (Firefox, IE , etc,…), type forum.microsync.net for testing (Don’t forget modify hosts file before do this step.) or you can use ping command to view the IP respond. If everything look good, do next step :-)

Second, we need Apache web server. In this lab, I think we must not to waste a lot of time for setup a “real” Apache web server, just  use xampp because it very simple: download, next, next and we have a full server with Apache, PHP, phpMyAdmin,… I guess you can setup xampp no need any instruction from me. After install, don’t try to run Apache because it can be start. Why ? –> Port 80 in use under IIS7, none other web server can use it !

Don’t forget we have 2 IPs and they are belong to IIS7, ! Now, just setup IIS for listenning only one IP (192.168.0.100). Open command line :

1. Type netsh

2. Netsh prompt appear (like netsh>), type http

3. Http prompt appear (like netsh http>), type show iplisten to list all IPs address are listened

IP addresses presents in the IP listen list :

———————————————————-

192.168.0.100

192.168.0.200

4. Continue type add iplisten ipaddress=192.168.0.100. Type show iplisten again and you will see only the IP 192.168.0.100 is listed. Now, 192.168.0.200 is “free”. Close/exit netsh.

5. Modify Apache config file to set it to listen 192.168.0.200 on port 80, add a virtual host blog.microsync.net to 192.168.0.200. Start Apache and test it in a browser.

What is result? Yeah, now we can run IIS and Apache web server at same server on same port 80.

  • Share/Bookmark

No Responses to “Run IIS and Apache webserver on same machine on same port (80)”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">
CommentLuv Enabled