将地址映射到多个tomcat实例
我有 3 个 tomcat 实例在 Windows Server 2008 机器上运行。每一个都有一个应用程序:
如何配置我的服务器来映射没有端口号的地址?
是tomcat配置还是带DNS的东西?
谢谢。
好的,我尝试了以下操作:
- 设置 Apache 2.2
- 配置 httpd.conf 加载代理模块
并添加代理模块配置:
代理请求关闭 ProxyPass /app1 http://machine:8081/app ProxyPassReverse /app1 http://machine:8081/app <位置“/app”> 订单允许、拒绝 允许所有
现在重定向在计算机本地运行良好。但当我尝试从同一网络中的另一台计算机访问时,它不起作用。 (这另一台机器可以 ping '机器' 主机。我也尝试输入 IP 号码)。
I have 3 tomcat instances running on Windows Server 2008 machine. Each one with one app:
How I can configure my server to map an address without the port number?
Is it a tomcat configuration or something with DNS?
Thanks.
Ok, I tried the following:
- Set up the Apache 2.2
- Configure httpd.conf loading proxy modules
And add a proxy module configuration:
ProxyRequests Off ProxyPass /app1 http://machine:8081/app ProxyPassReverse /app1 http://machine:8081/app <Location "/app"> Order allow,deny Allow from all </Location>
Now the redirect works well local in the machine. But it doesn't works when I try access from another machine in the same network. (this another machine can ping 'machine' host. And I tried putting the ip number too).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
例如,您可以使用 nginx (http://nginx.org/en/docs/) 作为代理。
简单地尝试(无负载平衡等):
其他端口同样如此
You can use nginx (http://nginx.org/en/docs/) as proxy for example.
Try simply (no load balancing etc.):
Same way for other ports
在 Apache 后面使用多个 Tomcat 来进行负载平衡是很常见的。虽然这不是负载平衡,但原理是相同的。您将拥有 3 个应用程序,每个应用程序包含 1 个 Tomcat Worker,而不是拥有一个具有 3 个负载平衡 Tomcat Worker 的应用程序。
您可以在此处找到 tomcat 文档:http://tomcat.apache.org/connectors-doc/
It is quite common to use multiple Tomcats behind Apache to do load balancing. While this is not load balancing the principle is the same. Instead of having one application with 3 load-balanced Tomcat workers, you would have 3 applications with 1 tomcat worker each.
You can find the tomcat documentation here: http://tomcat.apache.org/connectors-doc/
在
httpd
中尝试以下代码的mod 代理配置
:Try
mod proxy configuration
on below code inhttpd
: