简体   繁体   English

Apache和IIS在同一服务器/端口上

[英]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. 我有一台在端口80上运行IIS的服务器。同一台服务器还安装了Apache,正在侦听其他端口。

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. 我要实现的目标如下:1.设置Apache,使其也侦听端口80,但仅侦听特定的CNAME /别名。 2. Change the IIS web site settings, so that it ignores requests made to that specific CNAME. 2.更改IIS网站设置,以便它忽略对特定CNAME的请求。 Basically, if someone tries to access the web site using the specified CNAME, they should receive the content hosted on the Apache server. 基本上,如果有人尝试使用指定的CNAME访问该网站,则他们应该收到Apache服务器上托管的内容。 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. 如果他们使用其他别名/主机名或通过指定IP地址访问它,则应从IIS网站获取内容。

Is there any way I could achieve that? 有什么办法可以实现?

You can't bind two processes to the same port, on the same IP. 您不能将两个进程绑定到同一IP上的同一端口。

Your options are this: 您的选择是这样的:

  1. Run Apache and IIS on different IPs, but both on port 80. 在不同的IP上运行Apache和IIS,但都在端口80上运行。

  2. Run Apache and IIS on different Ports, but on the same IP. 在不同的端口上但在相同的IP上运行Apache和IIS。

  3. Run Apache on port 80, IIS on 81, and have Apache proxy requests for specific domain names or URLs to IIS. 在端口80上运行Apache,在81上运行IIS,并具有针对特定域名或IIS URL的Apache代理请求。 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. Apache将充当前端,处理自己的网站,并将其他所有内容发送到IIS,IIS将把结果返回给Apache。

It sounds like what you want is #3. 听起来您想要的是#3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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