You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Henri Gomez <he...@gmail.com> on 2008/09/22 16:36:03 UTC

mod_jk / Tomcat 6 and ErrorDocument

Hi to all,

Did some of you experienced problems with mod_jk 1.2.26 (and maybe
earlier release) and Apache 2.x ErrorDocument directive.

In one of my configuration I set :

    ErrorDocument 404 /gen_error404.html
    ErrorDocument 500 /gen_error500.html
    ErrorDocument 503 /gen_error503.html

    JkMount /sitea/* wsitea
    JkMount /siteb/* wsitea
    JkOptions +ForwardDirectories


When I look for a unexisting resource under Apache 2 control, I got
the content of gen_error404.html.
Also if the tomcat is unavailable I got back gen_error503.html page.

But if I'm looking for an unexisting resource under Tomcat control, I
get back the standard Tomcat 404 error instead of the
gen_error404.html.

Did there is some 'special settings' or configuration to be done on Apache/jk ?

Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Henri Gomez <he...@gmail.com>.
+1 for 1.2.27

2008/9/22 Mladen Turk <mt...@apache.org>:
> Rainer Jung wrote:
>>
>>
>> I have some spare time later this week and next weekend and plan to
>> finally do the IIS chunked encoding stuff. If we don't find anything
>> else important we should be able to have a testing tar ball at the end
>> of the month and soon after start the releasing process. We are a couple
>> of months over a regular schedule, but 1.2.26 was not too bad, and some
>> of the new features will be worth the longer waiting time (Mladen's
>> probing thread, per mount reply timeouts, IIS chunked encoding).
>>
>> I don't know if Mladen shares this opinion?
>>
>
> ++1
> Let's roll as soon as those things are done.
> I'll double check the status edits for the new params,
> and as soon you finish chunked encoding we are
> ready to go.
>
> Regards
> --
> ^(TM)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> 
> 
> I have some spare time later this week and next weekend and plan to
> finally do the IIS chunked encoding stuff. If we don't find anything
> else important we should be able to have a testing tar ball at the end
> of the month and soon after start the releasing process. We are a couple
> of months over a regular schedule, but 1.2.26 was not too bad, and some
> of the new features will be worth the longer waiting time (Mladen's
> probing thread, per mount reply timeouts, IIS chunked encoding).
> 
> I don't know if Mladen shares this opinion?
> 

++1
Let's roll as soon as those things are done.
I'll double check the status edits for the new params,
and as soon you finish chunked encoding we are
ready to go.

Regards
-- 
^(TM)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Rainer Jung <ra...@kippdata.de>.

Henri Gomez schrieb:
>> Right, sorry for the noise.
>> There is no way to have that at the moment.

Sorry to join the discussion to late, but yes: I think it always was
like that, no way of overwriting the Tomcat error pages inside Apache. I
put it on my personal TODO for mod_jk long ago :(

>> For normal replacement of error pages
>> this would have to be added to mod_jk.
>> It's a nice feature to have, but you'll have
>> to wait for 1.2.27 ;)
> 
> Any date for 1.2.27 ?

Mladen did some pretty interesting things lately. I have one question to
him open, to which I want to come back later this week, see

   http://marc.info/?l=tomcat-dev&m=120852255309277&w=2

I have some spare time later this week and next weekend and plan to
finally do the IIS chunked encoding stuff. If we don't find anything
else important we should be able to have a testing tar ball at the end
of the month and soon after start the releasing process. We are a couple
of months over a regular schedule, but 1.2.26 was not too bad, and some
of the new features will be worth the longer waiting time (Mladen's
probing thread, per mount reply timeouts, IIS chunked encoding).

I don't know if Mladen shares this opinion?

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Henri Gomez <he...@gmail.com>.
> Right, sorry for the noise.
> There is no way to have that at the moment.
> The code I've quoted is when there is error in sending the
> error page from the Tomcat, so in that case Httpd takes over,
> and sends intended page.

Yes.

> For normal replacement of error pages
> this would have to be added to mod_jk.
> It's a nice feature to have, but you'll have
> to wait for 1.2.27 ;)

Any date for 1.2.27 ?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
>>> Same thing for 404/500/503 I suppose.
>>>
>> Sure.
>>
>> if (!r->sent_bodyct && r->status >= HTTP_BAD_REQUEST) {
>>   ...
>>   return r->status;
>> }
> 
> I added to the conf/web.xml :
> 
>   <error-page>
>       <error-code>404</error-code>
>       <location>/empty-error.html</location>
>   </error-page>
> 
>   <error-page>
>     <error-code>500</error-code>
>     <location>/empty-error.html</location>
>   </error-page>
> 
>   <error-page>
>     <error-code>503</error-code>
>     <location>/empty-error.html</location>
>   </error-page>
> 
> 
> I tried with an empty-error.html and then with an inexisting error
> page, but I didn't get the ErrorDocument defined in Apache 2.2.x ;(
> 

Right, sorry for the noise.
There is no way to have that at the moment.
The code I've quoted is when there is error in sending the
error page from the Tomcat, so in that case Httpd takes over,
and sends intended page.

For normal replacement of error pages
this would have to be added to mod_jk.
It's a nice feature to have, but you'll have
to wait for 1.2.27 ;)


Regards
-- 
^(TM)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Henri Gomez <he...@gmail.com>.
Here is the corresponding jk debug trace :

[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): received from ajp13 pos=0 len=102 max=8192
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0000    04 01 94 00 0B 49 6E 74 72 6F 75 76 61 62 6C 65  -
.....Introuvable
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0010    00 00 04 00 04 45 54 61 67 00 00 13 57 2F 22 30  -
.....ETag...W/"0
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0020    2D 31 32 32 32 30 39 37 32 34 36 39 32 32 22 00  -
-1222097246922".
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0030    A0 05 00 1D 4D 6F 6E 2C 20 32 32 20 53 65 70 20  -
....Mon,.22.Sep.
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0040    32 30 30 38 20 31 35 3A 32 37 3A 32 36 20 47 4D  -
2008.15:27:26.GM
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0050    54 00 A0 01 00 09 74 65 78 74 2F 68 74 6D 6C 00  -
T.....text/html.
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0060    A0 03 00 01 30 00 00 00 00 00 00 00 00 00 00 00  -
....0...........
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(608): status = 404
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(615): Number of headers is = 4
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(671): Header[0] [ETag] = [W/"0-1222097246922"]
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(671): Header[1] [Last-Modified] = [Mon, 22 Sep 2008 15:27:26 GMT]
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(671): Header[2] [Content-Type] = [text/html]
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(671): Header[3] [Content-Length] = [0]
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): received from ajp13 pos=0 len=4 max=8192
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0000    03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  -
................
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): received from ajp13 pos=0 len=2 max=8192
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1117): 0000    05 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  -
................
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(1661): AJP13 protocol: Reuse is OK
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(691): (w849) resetting endpoint with sd = 1476
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] jk_ajp_common.c
(2522): recycling connection pool slot=0 for worker w849
[Mon Sep 22 17:41:17.813 2008] [2816:4076] [debug] mod_jk.c (2348):
Service finished with status=404 for worker=w849


As you could see the Content-Length is '0', status is 404 but I didn't
get the error page :-(

I'm using Apache 2.2.9 / mod_jk 1.2.26 and Tomcat 6.0.18, everything
on an XP box.

Did the 'if (!r->sent_bodyct && r->status >= HTTP_BAD_REQUEST) {' is
allready in 1.2.26 ?

Regards

2008/9/22 Henri Gomez <he...@gmail.com>:
>> Here is the HTTP header dump on my Firefox :
>>
>> Date: Mon, 22 Sep 2008 15:28:37 GMT
>> Server: Apache/2.2.9 (Win32) DAV/2 mod_jk/1.2.26 SVN/1.4.5
>> Etag: W/"0-1222097246922"
>> Last-Modified: Mon, 22 Sep 2008 15:27:26 GMT
>> Vary: Accept-Encoding
>> Content-Encoding: gzip
>> Content-Type: text/html
>>
>> 404 Introuvable
>
>
> Same dump when reaching Tomcat thru it's Coyote connector :
>
> Server: Apache-Coyote/1.1
> Etag: W/"0-1222097246922"
> Last-Modified: Mon, 22 Sep 2008 15:27:26 GMT
> Content-Type: text/html
> Content-Length: 0
> Date: Mon, 22 Sep 2008 15:29:59 GMT
>
> 404 Introuvable
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Henri Gomez <he...@gmail.com>.
> Here is the HTTP header dump on my Firefox :
>
> Date: Mon, 22 Sep 2008 15:28:37 GMT
> Server: Apache/2.2.9 (Win32) DAV/2 mod_jk/1.2.26 SVN/1.4.5
> Etag: W/"0-1222097246922"
> Last-Modified: Mon, 22 Sep 2008 15:27:26 GMT
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Content-Type: text/html
>
> 404 Introuvable


Same dump when reaching Tomcat thru it's Coyote connector :

Server: Apache-Coyote/1.1
Etag: W/"0-1222097246922"
Last-Modified: Mon, 22 Sep 2008 15:27:26 GMT
Content-Type: text/html
Content-Length: 0
Date: Mon, 22 Sep 2008 15:29:59 GMT

404 Introuvable

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Henri Gomez <he...@gmail.com>.
>> Same thing for 404/500/503 I suppose.
>>
>
> Sure.
>
> if (!r->sent_bodyct && r->status >= HTTP_BAD_REQUEST) {
>   ...
>   return r->status;
> }

I added to the conf/web.xml :

  <error-page>
      <error-code>404</error-code>
      <location>/empty-error.html</location>
  </error-page>

  <error-page>
    <error-code>500</error-code>
    <location>/empty-error.html</location>
  </error-page>

  <error-page>
    <error-code>503</error-code>
    <location>/empty-error.html</location>
  </error-page>


I tried with an empty-error.html and then with an inexisting error
page, but I didn't get the ErrorDocument defined in Apache 2.2.x ;(

Here is the HTTP header dump on my Firefox :

Date: Mon, 22 Sep 2008 15:28:37 GMT
Server: Apache/2.2.9 (Win32) DAV/2 mod_jk/1.2.26 SVN/1.4.5
Etag: W/"0-1222097246922"
Last-Modified: Mon, 22 Sep 2008 15:27:26 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html

404 Introuvable

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
> Hum good idea.
> 
> Same thing for 404/500/503 I suppose.
> 

Sure.

if (!r->sent_bodyct && r->status >= HTTP_BAD_REQUEST) {
    ...
    return r->status;
}


Regards
-- 
^(TM)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Henri Gomez <he...@gmail.com>.
Hum good idea.

Same thing for 404/500/503 I suppose.



2008/9/22 Mladen Turk <mt...@apache.org>:
> Henri Gomez wrote:
>>
>> Hi to all,
>>
>> Did some of you experienced problems with mod_jk 1.2.26 (and maybe
>> earlier release) and Apache 2.x ErrorDocument directive.
>>
>> In one of my configuration I set :
>>
>>    ErrorDocument 404 /gen_error404.html
>>    ErrorDocument 500 /gen_error500.html
>>    ErrorDocument 503 /gen_error503.html
>>
>>    JkMount /sitea/* wsitea
>>    JkMount /siteb/* wsitea
>>    JkOptions +ForwardDirectories
>>
>>
>> When I look for a unexisting resource under Apache 2 control, I got
>> the content of gen_error404.html.
>> Also if the tomcat is unavailable I got back gen_error503.html page.
>>
>> But if I'm looking for an unexisting resource under Tomcat control, I
>> get back the standard Tomcat 404 error instead of the
>> gen_error404.html.
>>
>> Did there is some 'special settings' or configuration to be done on
>> Apache/jk ?
>>
>
> Try creating custom 404 page for tomcat with zero length body.
> In that case Apache httpd error page will be shown
>
>
> Regards
> --
> ^(TM)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: mod_jk / Tomcat 6 and ErrorDocument

Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
> Hi to all,
> 
> Did some of you experienced problems with mod_jk 1.2.26 (and maybe
> earlier release) and Apache 2.x ErrorDocument directive.
> 
> In one of my configuration I set :
> 
>     ErrorDocument 404 /gen_error404.html
>     ErrorDocument 500 /gen_error500.html
>     ErrorDocument 503 /gen_error503.html
> 
>     JkMount /sitea/* wsitea
>     JkMount /siteb/* wsitea
>     JkOptions +ForwardDirectories
> 
> 
> When I look for a unexisting resource under Apache 2 control, I got
> the content of gen_error404.html.
> Also if the tomcat is unavailable I got back gen_error503.html page.
> 
> But if I'm looking for an unexisting resource under Tomcat control, I
> get back the standard Tomcat 404 error instead of the
> gen_error404.html.
> 
> Did there is some 'special settings' or configuration to be done on Apache/jk ?
>

Try creating custom 404 page for tomcat with zero length body.
In that case Apache httpd error page will be shown


Regards
-- 
^(TM)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org