You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by William Wong <ww...@atp.com> on 2001/06/28 08:08:23 UTC

apache mod_rewrite, mod_jk

Hi,
I had tried to setup mod_rewrite with mod_jk (ajp12 & ajp13) but with no
luck whatsoever. Even tried the approach mentioned in some of the postings
(dated Feb 2001) but without success.

The setup:
jdk1.3 (Sun)
RH7.1
apache-1.3.20 (DSO)
tomcat-3.2.2 (downloaded from jakarta.apache.org)
mod_jk.so (eapi) - downloaded from jakarta.apache.org

httpd.conf:
LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c

LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c

LoadModule ssl_module libexec/libssl.so
AddModule mod_ssl.c

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^/hello(.*) /examples/servlet/HelloWorldExample$1 [PT]
</IfModule>

Include "/install/jakarta-tomcat-3.2.2/conf/mod_jk.conf"

---[END OF httpd.conf]--------

The mod_jk.conf is copied from the mod_jk.conf-auto but the LoadModule is
remarked.

The following link works:
http://localhost/examples/servlet/HelloWorldExample

The following does not:
http://localhost/hello
The error on the screen:
Not Found(404)
Original request:/hello
Not found request:/hello

Tomcat log (mod_jk.log) shows:
YYYY-MM-DD 00:00:00 - Ctx( ):404 R( + /hello + null) null

Appreciate all the help I can get. Thanks for your time and attention.

-keng wong


Re: apache mod_rewrite, mod_jk

Posted by Jason Koeninger <jk...@jjcc.com>.
What do your JkMount directives look like?  If you've done 
something like:

JkMount /examples/* ajp13

I would think this would work fine (assuming the rewrite rule 
is done correctly...I'm no expert), but if you did something like:

JkMount /hello ajp13

I can see where there would be problems.  You, of course, don't 
want to mount the url you're trying to rewrite 

If you're doing something like:

JkMount /* ajp13

Then, I think you should back off and only mount the servlets until 
you get your rewrite rule done correctly.  I also don't know the 
interaction of mod_jk and mod_rewrite if they have competing 
entries so that may cause you some more trouble if you're 
pushing the whole site through to Tomcat.

Hope that helps.

Best Regards,

Jason Koeninger
J&J Computer Consulting
http://www.jjcc.com


On Wed, 27 Jun 2001 23:08:23 -0700, William Wong wrote:

>Hi,
>I had tried to setup mod_rewrite with mod_jk (ajp12 & ajp13) but with no
>luck whatsoever. Even tried the approach mentioned in some of the postings
>(dated Feb 2001) but without success.
>
>The setup:
>jdk1.3 (Sun)
>RH7.1
>apache-1.3.20 (DSO)
>tomcat-3.2.2 (downloaded from jakarta.apache.org)
>mod_jk.so (eapi) - downloaded from jakarta.apache.org
>
>httpd.conf:
>LoadModule jk_module libexec/mod_jk.so
>AddModule mod_jk.c
>
>LoadModule rewrite_module libexec/mod_rewrite.so
>AddModule mod_rewrite.c
>
>LoadModule ssl_module libexec/libssl.so
>AddModule mod_ssl.c
>
><IfModule mod_rewrite.c>
>  RewriteEngine on
>  RewriteRule ^/hello(.*) /examples/servlet/HelloWorldExample$1 [PT]
></IfModule>
>
>Include "/install/jakarta-tomcat-3.2.2/conf/mod_jk.conf"
>
>---[END OF httpd.conf]--------
>
>The mod_jk.conf is copied from the mod_jk.conf-auto but the LoadModule is
>remarked.
>
>The following link works:
>http://localhost/examples/servlet/HelloWorldExample
>
>The following does not:
>http://localhost/hello
>The error on the screen:
>Not Found(404)
>Original request:/hello
>Not found request:/hello
>
>Tomcat log (mod_jk.log) shows:
>YYYY-MM-DD 00:00:00 - Ctx( ):404 R( + /hello + null) null
>
>Appreciate all the help I can get. Thanks for your time and attention.
>
>-keng wong
>