logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: AJP bad response using mod_ajp_proxy or mod_jk
Author
davidmoxon



Joined: 29 Sep 2011
Posts: 3

PostPosted: Thu 29 Sep '11 16:43    Post subject: AJP bad response using mod_ajp_proxy or mod_jk Reply with quote

Hi guys, I'm having a serious issue with an Apache/mod_proxy/Tomcat setup, whereby the server arbitrarily returns garbage in the http response.

The problem presents itself when you load a page with several images. Repeated loads of this page randomly fail to load one or more of the images. After analysing the results (thanks Firefox web console), it appears the server is returning garbage in the response, and sometimes even posts the response header in the body along with other garbage.

Perhaps even weirder than that is, for the images that failed to load, there is no mention of them in the Apache access log, Tomcat access log or mod_jk debug log (when using mod_jk), for the page load in question.


See the following for an example of the garbage: http://www.box.net/shared/pbao4d8blk91f7vzhcnb


I've ruled out Tomcat and Apache by using each one as a direct web server, and also confirmed the issue occurs with both mod_ajp_proxy and mod_jk. The only common factor is the AJP bridge. I've messed with various parameters in the Apache and Tomcat configuration (such as maxThreads and backlog) and can't make the issue go away. Its almost as if the AJP connector in Tomcat is throwing a wobbly.

Interestingly, using mod_http_proxy works fine.


Notable portions of Tomcat's server.xml:
Code:

<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />

<Connector port="8011" protocol="AJP/1.3" redirectPort="443" />




Notable portions of Apache's httpd.conf:
Code:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

<IfModule proxy_module>
   ProxyPass /dev/css !
   ProxyPass /dev ajp://localhost:8011/dev
</IfModule>




Apache is running on port 80, Tomcat on port 8081 with an AJP connector on 8011. Tomcat has web app 'dev' which I've mapped to the /dev subfolder using the proxy setup.

Note that I'm also using Apache to server some static content from within the dev webapp, but this doesn't seem to have any effect on the issue.


I really want to use AJP and not have to fall back on the slower HTTP proxy.

Any help in working out what the hell is going on is greatly appreciated in advance!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 30 Sep '11 10:47    Post subject: Reply with quote

Which apache version do you use?

I have a simular setup for jenkins, but I also have a ProxyPassReverse in it. No clue if that make the difference. I also putted the pictures in the apache server, like you already did with the css.

Any chance to put the images on apache?
Back to top
davidmoxon



Joined: 29 Sep 2011
Posts: 3

PostPosted: Tue 04 Oct '11 16:57    Post subject: Reply with quote

Hey James,

I'm using Apache 2.2.21. I did already try with a ProxyPassReverse with no benefit.

I could server the images through Apache, which would solve this specific issue, but the issue is a larger one, in that AJP intermittently serves rubbish at a high enough frequency.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 04 Oct '11 17:28    Post subject: Reply with quote

In the picture you attached there is no response header. What is in that header?
Back to top
davidmoxon



Joined: 29 Sep 2011
Posts: 3

PostPosted: Tue 04 Oct '11 18:48    Post subject: Reply with quote

There is actually no response header at all. At least according to Firefox's web console.
Back to top
floyd



Joined: 02 Nov 2011
Posts: 1

PostPosted: Wed 02 Nov '11 3:44    Post subject: Reply with quote

Hi!

I seem to have the same problem. Randomly some images can't be loaded, sometimes also css files...

I use apache v2.2.8, mod_jk version JK-1.2.32, glassfish v3.1.1 on ubuntu 8.04

Did you already solve the problem?
Are there any further analytics to get nearer to the solution?

Thanks in advance!
Stefan
Back to top


Reply to topic   Topic: AJP bad response using mod_ajp_proxy or mod_jk View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules