0

我正在尝试在 tomcat 5.5 上运行修改后的 JWChat(一个简单的基于 javascript 的 jabber 客户端)。此应用程序基于 ajax,并使用 http 绑定来与 jabber 服务器通信(我使用的是 openfire)。在 apache 服务器上运行它时,它需要使用 mod_proxy 将请求重定向到 http-bind 并且它可以工作。有没有其他方法可以在tomcat上做同样的事情?我尝试了 UrlRewriteFilter,到目前为止没有运气。

4

2 回答 2

1

是一个很好的可用选项以及功能性 HTTP 代理 servlet 的源代码,看起来可以满足您的需求。

于 2009-05-23T12:52:04.547 回答
0

你总是可以在你的 web 应用程序前面放置一个透明的 apache 代理。这有额外的好处,比如缓存、重写、负载平衡、虚拟主机管理等。并不是说 Tomcat 不能做这些事情,只是说 apache 擅长这些事情并且有据可查。

它比你想象的要容易得多,你甚至可以将它与你的重写结合起来

# Proxy and Caching. Only proxy dynamic documents if this
# is the application server (or we waste disk space).
# [L] = Last rule [P] = Proxy
RewriteEngine On
RewriteRule \.(css|js|pdf|gif|jpg|png|swf|mp4|zip|exe)$ - [L]
RewriteRule (.*) http://www.yoursite.com:8000$1 [P]
CacheRoot "/var/www/cache/www.yoursite.com"
CacheSize 2000000
于 2009-05-23T12:53:38.913 回答