tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BugRat Mail System <tomcat-b...@cortexity.com>
Subject BugRat Report #64 has been filed.
Date Sat, 02 Sep 2000 00:28:20 GMT
Bug report #64 has just been filed.

You can view the report at the following URL:

   <http://znutar.cortexity.com:8888/BugRatViewer/ShowReport/64>

REPORT #64 Details.

Project: Tomcat
Category: Bug Report
SubCategory: New Bug Report
Class: swbug
State: received
Priority: medium
Severity: serious
Confidence: public
Environment: 
   Release: tomcat 3.1
   JVM Release: 1.2.2_05a (and 1.2.x)
   Operating System: Linux and SunOs
   OS Release: LRH6x and SunOS5.6 and 5.7
   Platform: Intelx86 and Sun E250

Synopsis: 
URLs changed by mod_rewrite are not taken into account by AjpConnectionHandler

Description:
Using apache1.3.12, tomcat3.1

mod_jserv + Tomcat do not deal properly with rewritten URIs. 
With this mount point:
	ApJServMount /wdlcontext  ajpv12://localhost:8008/wdlcontext1.4.0
this request:
	/wdlcontext/wdlInstall?blabla
will fail because tomcat will only use the original URI passed by mod_jserv
instead of using the context set by mod_jserv. 

This is very problematic when using mod_rewrite.

A patch-candidate for Ajp12ConnectionHandler.java is at the end. 
Could somebody please review it?

thanks.

jpa


==== debug message before the fix ===========
==> /local/jakarta-tomcat/logs/tomcat.log <==
AJP: CP=wdlcontext1.4.0
AJP: context=null
AJP: servlet=wdlInstall
AJP: serverName=dev.phoenixnet.com
AJP: PI=null
AJP: PT=null
AJP: QS=null
AJP: RA=134.122.3.102
AJP: RH=
AJP: RU=null
AJP: AT=null
AJP: Meth=GET
AJP: URI: /wdlcontext/wdlInstall CP:wdlcontext1.4.0 LP: null
AJP: URI: /wdlcontext/wdlInstall CP:wdlcontext1.4.0 LP: null
AJP: serverName=jabgrall2
AJP: Server jvmRoute=null
Request: /wdlcontext/wdlInstall
Query: null
ProcessRequest: R( /wdlcontext/wdlInstall)

==== debug message after the fix ============
==> /local/jakarta-tomcat/logs/tomcat.log <==
AJP: CP=wdlcontext1.4.0
AJP: context=Ctx(/wdlcontext1.4.0,/local/ebetween/contexts/wdlcontext1.4.0)
AJP: servlet=wdlInstall
AJP: serverName=dev.phoenixnet.com
AJP: PI=null
AJP: PT=null
AJP: QS=null
AJP: RA=134.122.3.102
AJP: RH=
AJP: RU=null
AJP: AT=null
AJP: Meth=GET
AJP: URI: /wdlcontext/wdlInstall CP:wdlcontext1.4.0 LP: null
AJP: URI: /wdlcontext/wdlInstall CP:wdlcontext1.4.0 LP: /wdlInstall
AJP: serverName=jabgrall2
AJP: Server jvmRoute=null
Request: /wdlcontext/wdlInstall
Query: null
ProcessRequest: R( /wdlcontext1.4.0 + /wdlInstall)
After processing: R( /wdlcontext1.4.0 + /wdlInstall + null)


======== PATCH FOR AJPV12 context lookup fix =========
--- Ajp12ConnectionHandler.java Thu Apr  6 19:11:36 2000
+++ Ajp12ConnectionHandler.java.fix     Sat Aug 12 22:30:36 2000
@@ -224,6 +224,16 @@
                    
                    if( contextPath!= null )
                        context=contextM.getContext( contextPath );
+                   /* 
+                    * XXX jpa:200008122227
+                    * With this mount:
+                    *    ApJServMount /wdlcontext1.4.0
ajpv12://localhost:8008/wdlcontext1.4.0
+                    * mod_jserv will return 'wdlcontext1.4.0' as the
mountpoint (=context)
+                    *  instead of '/wdlcontext1.4.0'
+                    * So let's try to fix it by adding the 
+                    */
+                   if( context == null )
+                       context=contextM.getContext( "/" + contextPath ); 
                    if( doLog ) log("AJP: context=" + context );
                    
                    servletName = ajpin.readString(null);         //Servlet
@@ -264,10 +274,25 @@
                    requestURI = ajpin.readString("");             //request
uri
                    if( doLog ) log("AJP: URI: " + requestURI + " CP:" +
contextPath + " LP: " + lookupPath);
 
-                   // XXX don't set lookup path - problems with URL
rewriting.
-                   // need to be fixed.
-                   //          if(contextPath!=null && contextPath.length()
>0 )
-                   //              lookupPath=requestURI.substring(
contextPath.length() + 1 );
+                   /* 
+                    * XXX jpa:200008122227
+                    * With this rewrite rule: 
+                    *  RewriteRule ^(.*)/wdlzone/wdlInstall
$1/wdlcontext1.4.0/wdlInstall [PT]
+                    * and this mount point:
+                    *  ApJServMount /wdlcontext1.4.0
ajpv12://localhost:8008/wdlcontext1.4.0
+                    * and this context
+                    *    <Context path = "/wdlcontext1.4.0" docBase = "....
+                    * and this request
+                    *    /wdlzone/wdlInstall?blabla
+                    * The contextPath (after the above '/' fixup) is
'/wdlcontext1.4.0'
+                    *  and the uri is '/wdlzone/wdlInstall' 
+                    * the servlet name is 'wdlInstall'
+                    * So the lookupPath is is based on the position of the
servlet name.
+                    * Prior to the following fix, zones and contexts in
mounting points were
+                    *  irrelevant. Only the original uri was then used by
tomcat.
+                    */
+                   if(contextPath!=null && contextPath.length() >0 )
+                       lookupPath=requestURI.substring(
requestURI.indexOf(servletName)-1 );
                    if( doLog ) log("AJP: URI: " + requestURI + " CP:" +
contextPath + " LP: " + lookupPath);
                    
                    dummy = ajpin.readString(null);
//script filename


---------------------------------------------------------------------


Mime
View raw message