--- Denis Haskin <[EMAIL PROTECTED]> wrote:
>... I guess I would recommend turning mod_rewrite logging up to
> full and make sure that the final rewritten URL from mod_rewrite is
> what you expect it to be.
The rewritten URL looks good to me.
> Actually, now that I read your message more closely, I'm not sure I
> understand the problem. It sounds like the requests *are* getting to
>
> Tomcat but they aren't in the form you expect when they get there?
> Or
> are the requests not getting to Tomcat at all?
Tomcat sees only the original request, not the rewritten URL.
> Perhaps some examples and some RewriteRule snippets would help.
Here's everything I could think of. The RewriteRule for this test is
RewriteRule ^/rewrite/examples(.*) /webapps/examples$1 [PT]
The rewrite log says
][rid#8650b0/initial] (3) applying pattern '^/rewrite/examples(.*)' to
uri '/rewrite/examples'
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (2) rewrite /rewrite/examples
-> /webapps/examples
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (2) forcing
'/webapps/examples' to get passed through to next API URI-to-filename
handler
* Response to http://localhost/webapps/examples:
... correct directory listing ...
* Response to http://localhost/rewrite/examples:
Not Found (404)
Original request: /rewrite/examples
Not found request: /rewrite/examples
* Additions to default httpd.conf:
LoadModule jk_module modules/mod_jk.dll
LoadModule rewrite_module modules/mod_rewrite.so
ClearModuleList
AddModule mod_so.c mod_mime.c mod_access.c mod_auth.c mod_negotiation.c
AddModule mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c
mod_userdir.c
AddModule mod_alias.c mod_env.c mod_log_config.c mod_asis.c mod_imap.c
AddModule mod_actions.c mod_setenvif.c mod_isapi.c
AddModule mod_jk.c
AddModule mod_rewrite.c
# Tomcat
<IfModule mod_jk.c>
JkWorkersFile d:/tomcat.prp
JkLogFile d:/apache1.3.20/logs/mod_jk.log
JkLogLevel debug
JkMount /*.jsp ajp12
JkMount /webapps/* ajp12
</IfModule>
# Rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions inherit
RewriteLogLevel 9
RewriteLog d:/apache1.3.20/logs/rewrite.log
RewriteRule ^/rewrite/examples(.*) /webapps/examples$1 [PT]
</IfModule>
* Changes to tomcat's default server.xml: changed context path
for /examples and /admin to /webapps/examples and /webapps/admin,
respectively.
* Tomcat properties file (tomcat.prp):
worker.list=ajp12, ajp13
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
worker.ajp12.lbfactor=1
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
* Tomcat console output:
Starting tomcat. Check logs/tomcat.log for error messages
2001-08-21 00:04:47 - ContextManager: Adding context Ctx(
/webapps/examples )
2001-08-21 00:04:47 - ContextManager: Adding context Ctx(
/webapps/admin )
2001-08-21 00:04:47 - ContextManager: Adding context Ctx( /admin )
2001-08-21 00:04:47 - ContextManager: Adding context Ctx( /examples )
2001-08-21 00:04:47 - ContextManager: Adding context Ctx( )
2001-08-21 00:04:47 - ContextManager: Adding context Ctx( /test )
2001-08-21 00:04:48 - PoolTcpConnector: Starting HttpConnectionHandler
on 8080
2001-08-21 00:04:48 - PoolTcpConnector: Starting Ajp12ConnectionHandler
on 8007
2001-08-21 00:05:25 - Ctx( ): 404 R( + /rewrite/examples + null) null
* Log files
$ cat access.log
127.0.0.1 - - [21/Aug/2001:00:05:17 -0400] "GET /webapps/examples
HTTP/1.1" 200 1406
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400] "GET /rewrite/examples
HTTP/1.1" 404 181
$ cat error.log
(empty)
$ cat rewrite.log
127.0.0.1 - - [21/Aug/2001:00:05:17 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (2) init rewrite engine with
requested uri /webapps/examples
127.0.0.1 - - [21/Aug/2001:00:05:17 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (3) applying pattern
'^/rewrite/examples(.*)' to uri '/webapps/examples'
127.0.0.1 - - [21/Aug/2001:00:05:17 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (1) pass through
/webapps/examples
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (2) init rewrite engine with
requested uri /rewrite/examples
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (3) applying pattern
'^/rewrite/examples(.*)' to uri '/rewrite/examples'
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (2) rewrite /rewrite/examples
-> /webapps/examples
127.0.0.1 - - [21/Aug/2001:00:05:25 -0400]
[foo.lan/sid#7a60f0][rid#8650b0/initial] (2) forcing
'/webapps/examples' to get passed through to next API URI-to-filename
handler
$ cat mod_jk.log
(lots of fairly uninformative stuff)
$ cat servlet.log
2001-08-21 00:04:47 - path="/webapps/examples" :jsp: init
2001-08-21 00:04:47 - path="/webapps/admin" :jsp: init
2001-08-21 00:04:47 - path="/admin" :jsp: init
2001-08-21 00:04:47 - path="/examples" :jsp: init
2001-08-21 00:04:48 - path="" :jsp: init
2001-08-21 00:04:48 - path="/test" :jsp: init
$ cat jasper.log
2001-08-21 00:04:47 - Scratch dir for the JSP engine is:
d:\tomcat3.2.3\work\localhost_8080%2Fwebapps%2Fexamples
2001-08-21 00:04:47 - IMPORTANT: Do not modify the generated servlets
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/