httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] Apache & mod_jk & 404
Date Mon, 11 May 2009 14:33:42 GMT wrote:
> Hi@all,
> We use in the apache jk config:
>     JkUnMount /admin/* ajp13
>     JkMount /* ajp13
> Now we have the effect, that apache send all page requests with have an 404er error code
(page not found) to tomcat.
> Example:
> http://locahost/admin/index.html --> Apache answerer itself
> http://locahost/admin/bla.txt --> Apache sends this to Tomcat
(I suppose you mean "localhost", right ?)

> Any idea how I can change that apache will server an 404er?
> Apache: apache2-worker-2.0.53-9.1
> JK: mod_jk/1.2.14
(Note : both are old versions, you know that ?)

Sorry to say it that way, but what you have written above (or how you 
have written it) is complete nonsense. ;-)

Apache does not decide to pass or not pass a request to Tomcat on the 
base of an error code (?!). How would that work ?
It would have to first try to serve the request, then see "hey, I can't 
find that thing, let's pass it to Tomcat !". It does not work that way.

Apache + mod_jk decide to pass a request to Tomcat or not based on the 
request URL.

So if your configuration has the line :

JkMount /* ajp13

and "ajp13" corresponds to a properly configured mod_jk "worker", which 
itself properly connects to a Tomcat back-end server,

then *all* requests will be forwarded by Apache to Tomcat (including the 
URL "/admin" by the way).

(Which in turn begs the question : why do you even have an Apache httpd 
and a mod_jk connector, since you are passing everything to Tomcat 
anyway ?  Why not just have Tomcat listening directly on port 80 and get 
rid of the additional Apache/mod_jk complication ?)

JkUnMount does the opposite. If you have the following 2 lines in your 
configuration :

JkMount /* ajp13
JkUnMount /admin/*

then it means that all requests will be processed by mod_jk (and passed 
to Tomcat), except the requests for URLs that start with "/admin/" (note 
the trailing /).  These will be processed by Apache, so Apache will 
expect to find a directory "admin" below its DocumentRoot, with things 
in it.

Then, when the request is being processed by either Apache or Tomcat, 
either one may find that what you request does not exist, and thus 
return a 404 error.  But that happens a lot later.

But with your 2 lines
JkMount /* ajp13
JkUnMount /admin/*
and your two requests
 > http://locahost/admin/index.html --> Apache answerer itself
 > http://locahost/admin/bla.txt --> Apache sends this to Tomcat
it is just impossible that one is being served by Tomcat and the other 
by Apache.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message