3

I am using mod_jk and apache http server to forward my request to two tomcats and which are up and running just fine.

I am using Chrome Browser plugin (Advanced Rest Client) to test this. When I make direct request to tomcat (port 8080), I get response header in the chrome plugin. But when I use apache (port 80), I get the proper response but the HTTP response header is blank.

I tried to search for this in Apache help, but could not find anything useful.

Please let me know if you need any more info.

Litmus
  • 10,558
  • 6
  • 29
  • 44
user578219
  • 597
  • 2
  • 9
  • 32
  • mod_jk does not use the http protocol to talk to the tomcat server. Only the session cookie would be transmitted back this way. Furthermore the apache http configuration plays a big role. You can inhibit/unset http headers in the response with mod_headers. Maybe you could post a little more information? – mwhs Oct 17 '13 at 15:59
  • Which version of `apache`, `tomcat` are you using?. Post your configuration settings here to seek help. `mod_jk` is kind of outdated, have you tried replacing it with `mod_proxy_ajp`? – Litmus Oct 18 '13 at 02:42

2 Answers2

0

Its hard to pinpoint the root cause unless more explanation is given. Please provide content of your workers.properties,httpd.conf.

For reference please visit this link for down-to-earth explation which works!!

fiberair
  • 641
  • 7
  • 17
0

"I get the proper response but the HTTP response header is blank." <- This sentence is illogical and a bit confusing since if you are missing the response header then in no way is the response "proper"; but I'm going to assume you are you saying you receive a correct response body (ie, HTML). That still leaves confusion over what you mean by the response header being blank because it's hard to tell if you mean the status line (first line of the response, ie: HTTP/1.1 200 OK) or the other header fields or both.

Starting with the status line, I'm going to assume that is actually present because if it wasn't your browser would almost certainly throw an error rather than show you the page (what I assume you mean by "proper response").

Now the other headers. By default Apache will normally add a few response headers related to the date and caching. It's actually pretty hard to turn all these off so I'm inclined to believe your response headers are in fact NOT BLANK in the transmitted data.

If I'm right then the most likely cause of your "problem" is not the server but the client, in particular the plugin you are using to view the headers. I don't know much about the plugin you are using but 2 possiblities come to mind:

1.) Apache is returning a header that your plugin can't parse. It would be a pretty rare thing for Apache to send invalid headers so the fault is probably the client-side parser.

2.) Your Apache options are forcing no-cache and/or no-store cache-control and this is causing the document to be expired and deleted BEFORE the plugin can read it.

In your position I would try one or more of the following:

1.) Try another browser and/or header display extension. I use the FF "Live HTTP Headers" extension.

2.) Try sniffing the data "on-the-wire" using a tool like WireShark to see what the server is REALLY sending

SpliFF
  • 38,186
  • 16
  • 91
  • 120
  • Thanks for your answer. Actually it's similar with my current issue so i started bounty on that. In my case header isn't blank. Just some custom headers are missing also last modified header date changed like below. "Last-Modified:Thu, 01 Jan 1970 00:00:00" But on my local it's working well. – XenoN Oct 18 '13 at 04:56
  • @XenoN : Did you ever find a solution to this ? I am too facing the same problem. – Shashank Kadne Jul 03 '14 at 11:43