简体   繁体   中英

Httpd mod_jk redirection to glassfish server doesnot work properly

I have this web-application hosted on Glassfish server which works fine if it is accessed directly on port 8080 over HTTP or 8181 over HTTPS.

In my production environment we have a front-end Webserver which is exposed over Internet. It is Apache httpd service, which comes bundled with RHEL server. This web server redirects requests using mod_jk module to appropriate back-end Application server. So I have configured my Glassfish server to have a JKListener listening on port xxx and Web server is configured to redirect any requests for my new web application to Glassfish JKListener.

At first it seems working fine, redirect happens as expected. But soon my web application stops responding, and nothing happens till I restart Glassfish server.

On digging into logs of mod_jk I found following errors -

1 - 

 [info] ajp_send_request::jk_ajp_common.c [1234] (worker) all endpoints are dissconnected , detected by connect check [1], cping (0), send (0)

2 -

 [info] jk_handler::mod_jk.c (2618): Service error=-3 for worker=worker1

 [error] ajp_service::jk_ajp_common.c (2559): (worker1) connecting to tomcat failed.

 [info] ajp_service::jk_ajp_common.c (2540): (worker1) sending request to tomcat failed 
 (recoverable), because of error during request sending (attempt=2)

 [error] ajp_send_request::jk_ajp_common.c (1585): (worker1) connecting to backend      failed. Tomcat is probably not started or is listening on the wrong port (errno=111)

 [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to   (A.B.C.D:xxx) (errno=111)

First log item was also repeated many times when everything seems working fine

There was nothing available regarding this in glassfish logs, below are the details of environment

  1. Front end web server : RHEL 4.5, Apache Httpd 2.0.57
  2. Web application server : RHEL 5.4 , glassfish 3.1.2.2
  3. Web application - uses JSF 2.1, Primefaes 3.5, using Primepush for server sent events

Did you add your page exception to virtualhosts? Try this : http://www.codefactorycr.com/glassfish-behind-apache.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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