Apache and IIS on same server

Posted on 2004-10-24
Last Modified: 2010-04-20
Can Apache be run on the same Windows Server as IIS, as I might want to test php files on Apache and asp on IIS?
Question by:ncw
    LVL 8

    Assisted Solution

    Certainly it can but they both cant run on the same port. So where IIS may be on port 80 you may need to set Apache on Port 8000. Or you can just run PHP scripts in IIS, its not that hard to configure.
    LVL 33

    Accepted Solution

    PHP runs well with IIS, so if that's your primary concern, you can go that route.  The two servers cannot listen to the same port on the same IP, so you can configure them to use different ports as KerryG suggested or you can use two IP addresses and bind IIS to one and Apache to the other.

    This is how to do either (from

    "IIS and Apache will default to listening on Port 80 (the http port).  IIS will also listen on all IP by default (even if you specify an ip for your http service in the IIS managment console).  Apache will listen on the IP (one or more) you specify in httpd.conf.

    But it's not possible for two apps to share the same port for the same IP, which explains your trouble.

    You have two solution to this problem depending the number of IP your machine are hosting.

    Only one IP

    So, you need to change the port of one of the servers.  One can listen on Port 80, the other on Port 8080 (or whatever).

    To change IIS to a new port :
    - IIS managment console : open the property page for your site (or the default if you wish to change all the site you are hosting) and switch "TCP Port" to an other value.
    - Web console : I just clicked through the Web-based config screens until I found the spot for changing the port.  Try it. Restart all the IIS services

    To change Apache to a new port :
    open httpd.conf and look for two lines, one is "Listen 80" (or listen YourIpAdress:80) and the other is "Port 80".  Change them to a different number, perhaps like this: Port 8080  Listen 8080

    Then save the file and restart the server.  Now you can have Apache running and IIS running.  One will run on the default 80 port, so should work ("mysite" should be the name of your site, of course).  The other will run on a different port, and will need to be specified, like this:

    More than one IP

    Follow these steps
    1 - disable the IIS multi address listning (this is the trick - open a console ([start] [execute] cmd ).
    At a command prompt, switch to the "C:\InetPub\AdminScripts" folder.
    Type the following command:  CSCRIPT ADSUTIL.VBS SET W3SVC/DisableSocketPooling TRUE
    exit the console
    Restart all the IIS process
    IIS is now listening only on the IP you wish !!!!!!!

    2 - specify the IP you wish for your IIS sites
    Open IIS managment console
    open the property page for each of your sites and set the "IP Adress" value.

    3 - specify the IP you wish for your Apache
    open httpd.conf.
    For each of your sites,
    - change the ligne   listen YourIpAdress:80.  
    - Change the virtualhost sections (if you have more than one site on
    your apache - refere to apache docs)

    4 - Restart apache and IIS

    You ar now hosting multisite on apache and IIS "
    LVL 1

    Author Comment

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: JavaScript Coding - Massive 12-Part Bundle

    Regardless of your programming skill level, you'll go from basics to advanced concepts in a vast array of JavaScript subjects including Sammy.js, Agility.js, Ember.js, Node.js, jQuery, AJAX, Extjs, AngularJS, Knockout.js, and JSON.

    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    913 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

    12 Experts available now in Live!

    Get 1:1 Help Now