Can I install apache and IIS together on same computer?

5,515

Solution 1

They will sit happily side by side - the only caveat is that you need to move at least one of them to a different port (for example, run IIS on port 80, and Apache on 88).

you haven't specified which version of Windows you'll be using, but to change the port for IIS you need to use "Internet Information Services" in control panel (under Administrative tools on Win XP, at least). Expand the tree And right click on Default Web Site, and select properties - the port is hidden in plain sight on the initial "Web Site" tab, and you should be able to pick a port number to suit.

Solution 2

Nothing should prevent you from installing everything - however, you will run into problems if you try to run [at least] both Apache & IIS at the same time as they will both want to use port 80 [ie default web port]. That said it should be pretty easy to configure either or both to use non standard ports so you can continue to run both and develop as you like.

Solution 3

While listening on different ports is one way to go about it, this might be possible - configure IIS and Apache to listen on different interfaces instead of listening on different ports.

e.g.

You have an ethernet card with an IP 10.10.10.10 and localhost 127.0.0.1. Configure Apache to listen on 127.0.0.1 and configure IIS to listen on 10.10.10.10 or vice versa. Then, edit your hosts file to point example.org to 127.0.0.1 and example.com to 10.10.10.10 or vice versa.

This way, you do not need to tell your browser to connect to http://localhost:8080 or anything like that, not that there is anything wrong with that.

Solution 4

You can run both server simultenously by changing port number of Apache or IIS.
A) How you can change Apache port number:

1) Open “httpd.conf” file located in folder “C:\wamp64\bin\apache\apache2.4.23\conf”. You can also open file directly from system try if your wamp is running.
2) Search for “listen” text in file and update the default port 80 to 8080.
3) Now Restart the WAMP server to make new port number effective.
4) Open the browser with url “http://localhost:8080/” wamp will show home page.
Reff: http://sforsuresh.in/iis-and-wamp-servers-on-the-same-system/

B) How you can change IIS port:
1) Go start and type IIS.
2) IIS Manager will open. click on “Default Web Site” on left hand side.
3) click on “bindings…” from the right side action section.
4) Popup will open with 80 port listed. select it and click the edit button.
5) Update the port and restart the server.Now try to access using browser.

Reff: http://sforsuresh.in/change-iis-port-windows/

Solution 5

As others have suggested, running IIS and Apache (and other web servers for that matter) on the same machine works well as long as they are assigned to listen on different ports.

If you are doing this on a public facing site you migth find hassle with some users who are behind very restrictive firewalls that do not allow much other than communication on standard HTTP(S) ports (80 and 443). One way around this issue is to put Apache on the standard port and use mod_proxy to make IIS serve specific directories. Another is to have both Apache and IIS on non-standard ports and run nginx on port 80 with a config containing something like:

location / {
  proxy_pass        http://localhost:8000;
  proxy_set_header  X-Real-IP  $remote_addr;
}
location /iis_app1 {
  proxy_pass        http://localhost:8000/iis_app1;
  proxy_set_header  X-Real-IP  $remote_addr;
}
location /iis_app2 {
  proxy_pass        http://localhost:8000/iis_app1;
  proxy_set_header  X-Real-IP  $remote_addr;
}
location /apache_app1 {
  proxy_pass        http://localhost:8001/apache_app1;
  proxy_set_header  X-Real-IP  $remote_addr;
}
location /apache_app2 {
  proxy_pass        http://localhost:8001/apache_app2;
  proxy_set_header  X-Real-IP  $remote_addr;
}

(the above assuming you have IIS listening on port 8000, Apache listening on port 8001, and IIS is intended to serve the root documents for the server (i.e. what a user gets in response to http://<servername_or_address>/.)

Using a proxy setup like either of the above means that you don't need to worry about making sure links within or pointing to your sites/applications carry the right port designator as everything is served from the standard port 80.

For personal testing/playing though, this is probably overkill.

Share:
5,515

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    I already installed Wamp (Windows, Apache, MySql and PHP). But now, I want to learn other language, i.e C# and C++ (probably C++ first, but not sure which one I should go first..)

    To use C# or C++, i want to install Visual Studio 2008 express edition and Microsoft Web Platform, that includes Visual Web Developer, SQL Server Express, Silverlight Tools, IIS and ASP.NET Extensions and more!

    Can I install all together (apache, mysql, php) and microsoft products (Sqlserver, C++, C#, IIS, silverlight etc)

  • ddelrio1986
    ddelrio1986 over 14 years
    Cool. I have pretty much php working files, I dont think I would change apache default port no. Is there any tutorial u could offer me to change IIS port no? So.... I just change IIS port number and I could install everything???? COOL, could not wait for it!!!
  • Admin
    Admin over 14 years
    I am using Vista Home premium :)
  • Dario Solera
    Dario Solera over 14 years
    Open the IIS manager (type IIS in the start menu), then select "Default Web Site" in the tree on the left. The menu on the right of the window has a "Bindings..." entry - click it and you'll be able to change the port (IIS works with bindings which are host:port pairs, each site can have multiple bindings). Changes are immediately applied.
  • Dario Solera
    Dario Solera over 14 years
    You have to install IIS first. You can do so in the Trunk Windows Features On or Off control panel entry. See here: technet.microsoft.com/en-us/library/cc754752%28WS.10%29.aspx