You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sven Schliesing <sc...@subshell.com> on 2009/07/16 10:22:41 UTC

[users@httpd] ProxyErrorOverride not working with mod_proxy_ajp

Hi,

I ran into a problem that my configured "ErrorDocument" for the code 404 is
ignored when using mod_proxy_ajp. Adding the directive "ProxyErrorOverride
On" has no effect. (like already described here [1])

Part of my config:
--------------------------
Listen localhost:80
<VirtualHost localhost:80>
        ServerName localhost
        
        DocumentRoot /var/www/myApp

        LogLevel debug

        LogFormat "%h %l %u %t \"%r\" %>s %b" common

        ErrorLog [...]
        CustomLog [...]
        
        ErrorDocument 404 /error.html

        ProxyPass  /myApp/ ajp://localhost:8009/myApp/
        ProxyPassReverse  /myApp/ ajp://localhost:8009/myApp/
        ProxyErrorOverride On
</VirtualHost>
--------------------------

error.log:
--------------------------
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy_ajp.c(45): proxy: AJP:
canonicalising URL //localhost:8009/myApp/notExistingDocument.html
[Thu Jul 16 10:05:30 2009] [debug] proxy_util.c(1489): [client 127.0.0.1]
proxy: ajp: found worker ajp://localhost:8009/myApp/ for
ajp://localhost:8009/myApp/notExistingDocument.html
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy.c(993): Running scheme ajp
handler (attempt 0)
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy_ajp.c(626): proxy: AJP: serving
URL ajp://localhost:8009/myApp/notExistingDocument.html
[Thu Jul 16 10:05:30 2009] [debug] proxy_util.c(1991): proxy: AJP: has
acquired connection for (localhost)
[Thu Jul 16 10:05:30 2009] [debug] proxy_util.c(2047): proxy: connecting
ajp://localhost:8009/myApp/notExistingDocument.html to localhost:8009
[Thu Jul 16 10:05:30 2009] [debug] proxy_util.c(2145): proxy: connected
/myApp/notExistingDocument.html to localhost:8009
[Thu Jul 16 10:05:30 2009] [debug] proxy_util.c(2300): proxy: AJP: fam 2
socket created to connect to localhost
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(224): Into
ajp_marshal_into_msgb
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[0] [Host] = [localhost:80]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[1] [User-Agent] = [Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US;
rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[2] [Accept] =
[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[3] [Accept-Language] = [en-us,en;q=0.5]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[4] [Accept-Encoding] = [gzip,deflate]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[5] [Accept-Charset] = [ISO-8859-1,utf-8;q=0.7,*;q=0.7]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[6] [Keep-Alive] = [300]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[7] [Connection] = [keep-alive]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[8] [Cache-Control] = [max-age=0]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(290): ajp_marshal_into_msgb:
Header[9] [Max-Forwards] = [50]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(430): ajp_marshal_into_msgb:
Done
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy_ajp.c(264): proxy:
APR_BUCKET_IS_EOS
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy_ajp.c(269): proxy: data to read
(max 8186 at 4)
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy_ajp.c(284): proxy: got 0 bytes
of data
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(667): ajp_read_header:
ajp_ilink_received 04
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(677): ajp_parse_type: got 04
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(496):
ajp_unmarshal_response: status = 404
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(517):
ajp_unmarshal_response: Number of headers is = 2
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(579):
ajp_unmarshal_response: Header[0] [Content-Type] = [text/html;charset=utf-8]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(589):
ajp_unmarshal_response: ap_set_content_type done
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(579):
ajp_unmarshal_response: Header[1] [Content-Length] = [1069]
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(667): ajp_read_header:
ajp_ilink_received 03
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(677): ajp_parse_type: got 03
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(667): ajp_read_header:
ajp_ilink_received 05
[Thu Jul 16 10:05:30 2009] [debug] ajp_header.c(677): ajp_parse_type: got 05
[Thu Jul 16 10:05:30 2009] [debug] mod_proxy_ajp.c(544): proxy: got response
from (null) (localhost)
[Thu Jul 16 10:05:30 2009] [debug] proxy_util.c(2009): proxy: AJP: has
released connection for (localhost)
--------------------------

The correct code (404) is sent. But Apache ignores it and displays tomcats
error page. I'm running Apache 2.2.3 but also tried with current release
(2.2.11). Same effect. Tomcat version is 6.0.18.

Any help would be appreciated.

Many thanks in advance!

Sven

[1]
http://www.nabble.com/Problem-with-ProxyErrorOverride-and-Tomcat-AJP-td10644728.html#a10644728
-- 
View this message in context: http://www.nabble.com/ProxyErrorOverride-not-working-with-mod_proxy_ajp-tp24512350p24512350.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