简体   繁体   中英

Apache and IIS on the same server/port

I have a server running IIS on port 80. The same server also has Apache installed, which is listening to other ports.

What I would like to achieve is the following: 1. Set up Apache so that it also listens on port 80, but only for a specific CNAME/alias. 2. Change the IIS web site settings, so that it ignores requests made to that specific CNAME. Basically, if someone tries to access the web site using the specified CNAME, they should receive the content hosted on the Apache server. If they access it using another alias/host name, or by specifying the IP address, they should get the content from the IIS web site.

Is there any way I could achieve that?

You can't bind two processes to the same port, on the same IP.

Your options are this:

  1. Run Apache and IIS on different IPs, but both on port 80.

  2. Run Apache and IIS on different Ports, but on the same IP.

  3. Run Apache on port 80, IIS on 81, and have Apache proxy requests for specific domain names or URLs to IIS. This will be done transparently to the user. Apache will act as the front-end, handling it's own websites, and sending everything else to IIS, which will return back to Apache the results.

It sounds like what you want is #3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM