You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Mearns <me...@gmail.com> on 2009/04/28 15:27:17 UTC

Re: [users@httpd] HTML source rather than rendered page with mod_proxy_ajp

On Tue, Apr 28, 2009 at 8:43 AM, mr_b <ra...@gmx.at> wrote:
> Hi! I run use mod_proxy_ajp to run several JBosses behind an Apache HTTP
> server (OS is Centos5). My problem: "occasionally" the browser displays the
> HTML source code of the page rather than the rendered page itself. (Sorry
> for not being more specific - I really couldn't find any reproducible cause
> or pattern yet. Happens with small pages as well as large ones). I
> configured virtual hosts in my http.conf like that: ServerName
> myserver01.mydomain DocumentRoot /var/www/html ProxyPass / ajp:// Any idea
> about what's causing this appreciated! Thanks!
> ________________________________
> View this message in context: HTML source rather than rendered page with
> mod_proxy_ajp
> Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
>

This probably isn't much help (sorry, don't know much about proxying,
or anything about JBosses), but the problem (assuming it's not a
bizarre browser bug) is almost definitely caused by sending the
incorrect content-type header to the client. It should be text/html,
not text/plain. Why the wrong type is getting sent, I have no idea.

-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HTML source rather than rendered page with mod_proxy_ajp

Posted by mr_b <ra...@gmx.at>.
Hi Brian, 

yes, the content type seems to be the issue. But the JBoss is definitely
sending out the right type; it appears that it gets 'lost' in the proxy for
some reason occasionally...

Cheers,
Rainer



Brian Mearns-2 wrote:
> 
> On Tue, Apr 28, 2009 at 8:43 AM, mr_b <ra...@gmx.at> wrote:
>> Hi! I run use mod_proxy_ajp to run several JBosses behind an Apache HTTP
>> server (OS is Centos5). My problem: "occasionally" the browser displays
>> the
>> HTML source code of the page rather than the rendered page itself. (Sorry
>> for not being more specific - I really couldn't find any reproducible
>> cause
>> or pattern yet. Happens with small pages as well as large ones). I
>> configured virtual hosts in my http.conf like that: ServerName
>> myserver01.mydomain DocumentRoot /var/www/html ProxyPass / ajp:// Any
>> idea
>> about what's causing this appreciated! Thanks!
>> ________________________________
>> View this message in context: HTML source rather than rendered page with
>> mod_proxy_ajp
>> Sent from the Apache HTTP Server - Users mailing list archive at
>> Nabble.com.
>>
> 
> This probably isn't much help (sorry, don't know much about proxying,
> or anything about JBosses), but the problem (assuming it's not a
> bizarre browser bug) is almost definitely caused by sending the
> incorrect content-type header to the client. It should be text/html,
> not text/plain. Why the wrong type is getting sent, I have no idea.
> 
> -Brian
> 
> -- 
> Feel free to contact me using PGP Encryption:
> Key Id: 0x3AA70848
> Available from: http://keys.gnupg.net
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/HTML-source-rather-than-rendered-page-with-mod_proxy_ajp-tp23276352p23292456.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HTML source rather than rendered page with mod_proxy_ajp

Posted by Brian Mearns <me...@gmail.com>.
On Tue, Apr 28, 2009 at 9:39 AM, André Warnier <aw...@ice-sa.com> wrote:
> Brian Mearns wrote:
>>
>> On Tue, Apr 28, 2009 at 8:43 AM, mr_b <ra...@gmx.at> wrote:
>>>
>>> Hi! I run use mod_proxy_ajp to run several JBosses behind an Apache HTTP
>>> server (OS is Centos5). My problem: "occasionally" the browser displays
>>> the
>>> HTML source code of the page rather than the rendered page itself. (Sorry
>>> for not being more specific - I really couldn't find any reproducible
>>> cause
>>> or pattern yet. Happens with small pages as well as large ones). I
>>> configured virtual hosts in my http.conf like that: ServerName
>>> myserver01.mydomain DocumentRoot /var/www/html ProxyPass / ajp:// Any
>>> idea
>>> about what's causing this appreciated! Thanks!
>>> ________________________________
>>> View this message in context: HTML source rather than rendered page with
>>> mod_proxy_ajp
>>> Sent from the Apache HTTP Server - Users mailing list archive at
>>> Nabble.com.
>>>
>>
>> This probably isn't much help (sorry, don't know much about proxying,
>> or anything about JBosses), but the problem (assuming it's not a
>> bizarre browser bug) is almost definitely caused by sending the
>> incorrect content-type header to the client. It should be text/html,
>> not text/plain. Why the wrong type is getting sent, I have no idea.
>>
> I agree with the previous comment, and anyway it would be the first thing to
> check.
> For each browser, there exist plugins/add-ons which allow you to see what
> exactly the server is sending as HTTP headers together with the page itself.
> (For Firefox, see HttpFox; for IE, try Fiddler2).
> Once installed, activate the relevant plugin. That will create an additional
> window which shows the HTTP headers going out and coming in.
> Then go back to the main window, and access your application until you get
> such a case.
> Then switch to the plugin window, and see which HTTP headers the server sent
> together with that page.
> One of them will be the "Content-type" header.
>
>

If you're at least vaguely comfortable with the command line, you can
also just telnet to your machine to check the content-type. The
command is like:
$> telnet myserver 80
Assuming your server is listening on port 80. Once connected, just type this:
HEAD /thepage.html HTTP/1.0

Make sure you include a blank line at the end of it. You should get
back just the HTTP headers for thepage.html (or whatever page you
want). Ctrl-C to exit telnet if it doesn't automatically.

-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HTML source rather than rendered page with mod_proxy_ajp

Posted by André Warnier <aw...@ice-sa.com>.
Brian Mearns wrote:
> On Tue, Apr 28, 2009 at 8:43 AM, mr_b <ra...@gmx.at> wrote:
>> Hi! I run use mod_proxy_ajp to run several JBosses behind an Apache HTTP
>> server (OS is Centos5). My problem: "occasionally" the browser displays the
>> HTML source code of the page rather than the rendered page itself. (Sorry
>> for not being more specific - I really couldn't find any reproducible cause
>> or pattern yet. Happens with small pages as well as large ones). I
>> configured virtual hosts in my http.conf like that: ServerName
>> myserver01.mydomain DocumentRoot /var/www/html ProxyPass / ajp:// Any idea
>> about what's causing this appreciated! Thanks!
>> ________________________________
>> View this message in context: HTML source rather than rendered page with
>> mod_proxy_ajp
>> Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
>>
> 
> This probably isn't much help (sorry, don't know much about proxying,
> or anything about JBosses), but the problem (assuming it's not a
> bizarre browser bug) is almost definitely caused by sending the
> incorrect content-type header to the client. It should be text/html,
> not text/plain. Why the wrong type is getting sent, I have no idea.
> 
I agree with the previous comment, and anyway it would be the first 
thing to check.
For each browser, there exist plugins/add-ons which allow you to see 
what exactly the server is sending as HTTP headers together with the 
page itself.
(For Firefox, see HttpFox; for IE, try Fiddler2).
Once installed, activate the relevant plugin. That will create an 
additional window which shows the HTTP headers going out and coming in.
Then go back to the main window, and access your application until you 
get such a case.
Then switch to the plugin window, and see which HTTP headers the server 
sent together with that page.
One of them will be the "Content-type" header.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org