Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect domain IIS to Apache

Tags:

iis

apache2

IIS Server is listening Port 80 and Apache is listening 8080

I deployed website on apache.

Domain name is registered on IIS server. How can I redirect to a call from IIS to Apache server. Like if I type

www.abc.com

(on IIS), it will redirect call to website on Apache server (on port 8080)

How can I do that?

like image 914
Dawid Sajdak Avatar asked Oct 08 '13 11:10

Dawid Sajdak


People also ask

Can Apache and IIS run on same server?

Simultaneous ServersYou can install Apache and IIS on the same Windows PC at the same time. Although the applications will run, they both listen for web requests on TCP port 80 — there will be clashes so a little configuration is required.


Video Answer


1 Answers

You need to setup a reverse proxy on IIS and point it to the apache server. Here is a blog post about how to set it up: http://blogs.iis.net/carlosag/archive/2010/04/01/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr.aspx

It requires setting up URL Rewrite and Application Request Routing.

Excerpt from the blog post:

  1. The first thing you need to do is enable Proxy support in ARR.

    1. To do that just launch IIS Manager and click the server node in the tree view.
    2. Double click the “Application Request Routing Cache” icon
    3. Select the “Server Proxy Settings…” task in the Actions panel
    4. And Make sure that “Enable Proxy” checkbox is marked. What this will do is allow any request in the server that is rewritten to a server that is not the local machine will be routed to the right place automatically without any further configuration.
  2. Configure URL Rewrite to route the right folders and their requests to the right site. But rather than bothering you with UI steps I will show you the configuration and then explain step by step what each piece is doing.

  3. Note that for this post I will only take care of Company1, but you can imagine the same steps apply for Company2, and to test this you can just save the configuration file below as web.config and save it in your inetpub\wwwroot\ or in any other site root and you can test it.

like image 156
Jon Lin Avatar answered Sep 19 '22 22:09

Jon Lin