将重定向到另一台服务器上的应用程序 [英] Tomcate redirect to application on another server

查看:123
本文介绍了将重定向到另一台服务器上的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

首先让我解释一下这个话题,
场景是我在服务器上有一个Java Web应用程序(假设APP-SERVER),并且使用另一台服务器(假设MAIN-SERVER)上的apache2.2对该应用程序进行了外部访问,该访问实际上是先从外部进行的请求到达MAIN-SERVER上的apache,然后此apache将此请求重定向到安装了应用程序的MAIN-SERVER上的另一个apache,然后此apache将此请求重定向到同一服务器(MAIN-SERVER)上的应用程序.

实际上,这是实际配置的东西,但是现在的问题是,外部访问可以正常工作20-30天,而且没有问题,万一它出现故障,那么我可以去现场在两台服务器上重新启动apache,然后它又开始工作了……但是一段时间之后,这种外部访问又再次下降了……而现在我也发生了同样的事情,这次,它几乎每天都崩溃,甚至一天两次,并且客户非常不高兴.现在.

自上四天以来,我一直在搜索网络,但仍然找不到解决方案或任何其他更好或更简单的方法来进行此重定向.因此,请向我建议一些配置外部访问的良好机制(因为当前conf再次下降n)

注意:客户端IT已经配置了MAIN-SERVER来接收外部访问,现在我要配置的是将请求从该服务器重定向到已安装应用程序的服务器(APP-SERVER).

我今天成功完成的一件事是在Apache中添加index.html页面,该页面具有一些简单的javascript代码,这些代码使用其IP例如重定向到另一台服务器上的应用程序.

Hi everyone,

First let me explain the topic,
the scenario is that I''ve an java web application on a server (let suppose APP-SERVER) and an external access is configured to this application using apache2.2 on another server (let suppose MAIN-SERVER) that actually from outside first request comes to apache on MAIN-SERVER and then this apache redirects this request to another apache on MAIN-SERVER where application is installed and then this apache redirect this request to the application on this same server (MAIN-SERVER).

actually this is something that is actually configured, but now the issue is some time the external access work very fine for long time 20-30days with no issue and in case it goes down then I go to the site and restart apache on both servers and then its become working again ... but some time this external access goes down again again ... and the same is happening to me now a days and this time it goes down almost every day even twice in a day and client is very upset now.

I''m searching the net since last 4day but still unable to find the solution or any other better or easy way to do this redirection. so please suggest me some good mechanism to configure external access (because current conf goes down again n again)

note: MAIN-SERVER is already configured by the client IT to recieve external access now what I''ve to configure is to redirect request from this server to the server having Application installed (APP-SERVER).

In one thing i succeeded today is to add index.html page in Apache having some simple javascript code that redirects to application on another server using its IP e.g.

http://APP-SERVER IP:8080/application

,但我认为这将无法正常工作,因为它将完整的URL重定向到APP-SERVER,并且在外部无法访问此APP-SERVER .

因此,请至少提供任何有助于我解决此问题的建议,或为该情况设置任何更好的机制

非常感谢,因为我真的很赞.


另外还有一件事需要我纠正,因此我的Google-ing应该在正确的路径上....这种情况称为将TOMCAT重定向到另一台服务器"之类的东西...正确??

but i think this will not works because it redirects the complete URL to APP-SERVER and externally this APP-SERVER is not accessible.

so please at-least any suggestion that helps me in resolving this issue or to setup any better mechanism for this scenario

THANKS REALLY BECAUSE I''M REALLY UPSET.


Also one more thing for my correction so my google-ing should on right path .... that this scenario is called some thing like "TOMCAT REDIRECT TO ANOTHER SERVER" ... correct ??

推荐答案

转到 Apache文档 [
Go to the Apache documentation[^] and read up on redirection (mod_rewrite, etc) and proxying (mod_proxy). You should be doing this at the Apache level, not Tomcat.
Also, if you join the Apache users mailing list, you will be able to get help about why it fails in the first place. (They will want configuration information and logs from the time of the failure.)
Better still, before you join the list, search the Apache website. There is almost certainly someone else''s story about a very similar issue.

Peter


这篇关于将重定向到另一台服务器上的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆