Apache2 反向代理似乎间歇性冻结?

tin*_*nny 6 tomcat web-applications reverse-proxy apache-2.2

代理 tomcat Web 应用程序时,Apache2 反向代理似乎间歇性冻结。

问题是,当我尝试登录到这个代理的 Web 应用程序时,它经常(一天一两次,通常是在不活动后)冻结。应用程序只是无限期地冻结,没有 500 响应代码......浏览器只是等待和等待。

如果我不断尝试从我的浏览器提示网址,它最终会重新开始工作。

我试图通过直接导航到 tomcat 端口 8080 上的 Web 应用程序来重现此问题,但如果不通过反向代理,我就无法重现此问题。

这是我的反向代理配置...任何故障查找想法?谢谢

/etc/apache2/sites-available/default

ProxyPass /manage/ http://localhost:8080/manage/
ProxyPassReverse /manage/ http://localhost:8080/manage/

ProxyPass /manage http://localhost:8080/manage
ProxyPassReverse /manage http://localhost:8080/manage
Run Code Online (Sandbox Code Playgroud)

/etc/apache2/mods-available/proxy.conf

  <IfModule mod_proxy.c>
    #turning ProxyRequests on and allowing proxying from all may allow
        #spammers to use your proxy to send email.

        ProxyRequests Off

        <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Deny from all
                Allow from all
        </Proxy>

        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
        # Set to one of: Off | On | Full | Block

        ProxyVia On
    </IfModule>
Run Code Online (Sandbox Code Playgroud)

更多信息:(不确定是否相关)

启用 apache 模块:

core_module (static) log_config_module (static) logio_module (static) mpm_worker_module (static) http_module (static) so_module (static) alias_module (shared) auth_basic_module (shared) authn_file_module (shared) authz_default_module (shared) authz_groupfile_module (authz_host_module) (auzshared_module)共享)autoindex_module(共享)cgid_module(共享)deflate_module(共享)dir_module(共享)env_module(共享)mime_module(共享)negotiation_module(共享)proxy_module(共享)proxy_ajp_module(共享)proxy_connect_module(共享)proxy_http_module(共享)reqtimeout_module rewrite_module (共享) setenvif_module (共享) status_module (共享)

更新:我现在使用 ajp 协议作为代理。已经设置了一些额外的 ProxyPass 配置,例如

ProxyPass /manage ajp://localhost:8009/manage max=20 ttl=120 acquire=10000 retry=0
ProxyPassReverse /manage ajp://localhost:8009/manage
Run Code Online (Sandbox Code Playgroud)

Pau*_*aul 1

我会尝试使用 ajp 从 apache 连接到 tomcat。
请使用 mod_proxy_ajp 和 Tomcat 测试配置。
从日志来看,tomcat没有响应apache的请求。它拒绝连接。

如果您的流量较高,请在应用程序日志中进行更深入的搜索。这可能是死锁或达到最大线程数。

华泰