简体   繁体   English

如何在两个不同的端口上运行Apache2.4并同时设置proxypass和reversepass(Windows 2012)?

[英]How to run Apache2.4 on two different Ports and set up proxypass and reversepass at the same time (Windows 2012)?

My question is actually double. 我的问题实际上是双重的。

1) I would like to have apache to run on two different port. 1)我想让apache在两个不同的端口上运行。 Port 80 and port 8000. 端口80和8000。

2 ) Both are actually front end reverse proxy to TOMCAT. 2)两者实际上都是TOMCAT的前端反向代理。

So far i know how to set up my reverseproxy directive with ajp for tomcat and everything works fine. 到目前为止,我知道如何使用ajp为tomcat设置我的reverseproxy指令,并且一切正常。

What i am confused about is 我感到困惑的是

a) how to you set the directive of reverse proxy to include the port too. a)如何设置反向代理指令也包括端口。

b) I red here and there that it is not enough to have the two directive to listen on two ports Listen 80 Listen 800 but one has to use virtual host to. b)我在这里和那里变红了,只有两个指令在两个端口上侦听是不够的。Listen 80 Listen 800,但是一个必须使用虚拟主机。

Please can someone guide me on what needs to be done for it work straight ? 请有人指导我直接工作需要做些什么?

As you alluded to, you'll want to use multiple vhosts. 正如您所暗示的,您将要使用多个虚拟主机。 The apache config will look something like: apache配置如下所示:

Listen 80
<VirtualHost *:80>
 ...
</VirtualHost>

Listen 8000
<VirtualHost *:8000>
 ...
</VirtualHost>

You can then include some of your config in both virtual hosts to centralize it in one place. 然后,您可以在两个虚拟主机中都包含一些配置,以将其集中在一处。 For more, see the documentation . 有关更多信息,请参见文档

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

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