IIS and Apache at the same time

Posted on 2004-11-30
Last Modified: 2008-12-09
I want to run apache and IIS at the same time for testing. How would I do this? Is there a way to have somethin like localhost2 or something? I think this is a pretty odd configuration I want but I sort of need it thanks.
Question by:SkyvanMan
    LVL 51

    Expert Comment

    either have them listen on different ports, or use at least 2 NICS, or have on NIC with virtual IP
    LVL 33

    Accepted Solution

    You can install 2 (or more) web servers on the same machine.  It's just software after all.  However, you can't have two applications using the same port on the same IP address.  That's where the second IP comes in.  You can either add a second network card or assign an additional IP to the single network card as ahoffman said.

    When you configure IIS, you configure it to use one IP (ie. and when you configure Apache, you configure it to use the other (ie.   You can run multiple websites on IIS/ with host headers and multiple websites on Apache/ with virtual hosts.  If you want to run multiple sites with individual IP's, just add more IP addresses to your NIC.

    The two web servers will still be in conflict because "when you start Internet Information Services (IIS) 6.0 on Microsoft Windows Server 2003, IIS binds to all IP addresses on the server, not just the IP addresses that are assigned to Web sites" (I believe Apache does the same).  Therefore, you need to bind each server to its specific IP address so that it doesn't bind to all IP addresses, just the one you want it to.

    Here's how to do it in Win2k3/IIS6:;en-us;813368&Product=iis60

    Here's how to do it in Apache 2.0:

    This same question was asked here:, so I've borrowed from my comments there.  You can check out that thread for a bit more detail.
    LVL 5

    Author Comment

    well part of your thing expects I am using IIS 6.0 however I am not. I am running XP Pro with IIS 5.1 So is it still the same?
    LVL 33

    Assisted Solution

    Good point.  WinXP/IIS5.1 is a fairly limited version of IIS, but I think it is still possible to disable socket pooling - see  This applies to IIS5.0 - presumably MS is thinking about Win2k Server here - but it's likely closer than the IIS 6 version.  I did a quick search and couldn't find any reference specifically indicating that it couldn't (or could) be done in IIS 5.1.
    LVL 33

    Expert Comment

    More searching, found a couple of reference that suggest kb238131 above will work with IIS 5.1.  Let us know how it works out.
    LVL 12

    Assisted Solution

    - Easiest way is to make your apache server listen on port 8080 which will not interfere with IIS which runs on port 80 by default.
    - Use Notepad to open the httpd.conf file (you can find it in your apache\apache2\conf directory) and scroll down to find the following lines...

    Listen (where is your IP)
    #Listen 80  

    Only one of the above needs to be enabled (The other can be disabled using the # at the beginning of the line).

    - Change the 80 in the first line to 8080

    - or if your httpd.conf file uses the Listen 80 line and the IP address line is commented out then, change
    Listen 80 to Listen 8080

    - Save your httpd.conf file. Make sure Notepad does not add a .txt to the file name :-)
    - Restart apache and you are in business.

    - You must access your sites on the apache server using the port number in the url...
    - Example:

    To access sites on IIS you don't have to specify the default port 80...
    - will access your IIS sites.

    Good luck!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now