You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Guy Katz <gk...@allot.com> on 2007/08/26 16:05:43 UTC

[mod_jk] problem serving URIs with 'special characters'

Hi; (using: centos, apache 2.0.52, mod_jk 1.2.21, tomcat 6)

Recently, I encountered a problem with URIs that has 'non western
European' characters (for example:
http://www.somehost.com/roller/admin/entry/nofx_%D7%91%D7%93%D7%A8%D7%9A
). I noticed that apache was forwarding to tomcat a different URI than
the original which caused problems in my site.

 

Digging into the subject I found the JkOptions +ForwardURICompatUnparsed
fixed my problem. However, I then encountered a different problem then.
On the first hit, some images were not displayed in the browser (not
served to it). So I checked the forums and found out about the
JkStripSession. I figured it might help so I turned it on but nothing
happened.

 

My questions are:

1.	Should the JkStripSession help in this case? Was there a known
bug in my apache/mod_jk versions related to this (couldn't find in
bugzilla)?
2.	How should I solve this? The only thing I need is to be able to
forward URIs with 'special characters' as is to tomcat for a specific
application (context)

 

I am really out of my element here so I would appreciate your help
greatly.

Thanks in advance

 

Related forum topic I found:

http://www.nabble.com/Image-problem-tf3629476.html#a10141944

http://www.nabble.com/-mod_jk--JkStripSession-directive-tf3294527.html#a
9164432

 

 

The configuration I thought would work but had the image loading
problem:

JkMount /* ajp13
JkStripSession On

JkOptions +ForwardURICompatUnparsed



#i think the following has nothing to do with my problem but its here
anyway...
RewriteEngine On
RewriteCond %{HTTP_HOST} !^waves.co.il$ [NC] RewriteRule ^(.*)$
http://www.xwave.co.il$1 [R,L] 

 

 

 

Guy Katz
R&D
Allot Communications * a mind for networks(tm)
Tel: + 972 9 761 928 8
Fax: + 972 9 744 362 6
gkatz@allot.com
www.allot.com <http://www.allot.com/> 

 

 


Re: [mod_jk] problem serving URIs with 'special characters'

Posted by Rainer Jung <ra...@kippdata.de>.
I agree with Christopher.

If you feel totally uncomfortable with the idea of compiling yourself: 
there is a good chance, that the downloadable binary for 2.0.59 will 
work with your 2.0.52. You need to test and check the error log of 
apache for log lines indicating process crashes. Those would be a sign, 
that the binaries are not compatible. Apart from possible crashes (which 
are obviously very bad), there are no other compatibility risks for 2.0.52.

Regards,

Rainer

Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Guy,
> 
> Guy Katz wrote:
>> Hi;
>> Sorry for the beginner's question but does this means that I need to
>> compile mod_jk1.2.25 against my apache 2.0.52? Or can I still use the
>> 1.2.25 from the tomcat connector downloads page as a drop-in
>> replacement.
> 
> IMO, you should /always/ compile your own. It's super easy to do, and
> you get a binary that is pretty much guaranteed to work properly with
> your version.
> 
> - -chris

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [mod_jk] problem serving URIs with 'special characters'

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Guy,

Guy Katz wrote:
> Hi;
> Sorry for the beginner's question but does this means that I need to
> compile mod_jk1.2.25 against my apache 2.0.52? Or can I still use the
> 1.2.25 from the tomcat connector downloads page as a drop-in
> replacement.

IMO, you should /always/ compile your own. It's super easy to do, and
you get a binary that is pretty much guaranteed to work properly with
your version.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG1CLR9CaO5/Lv0PARAhbDAKCFJWHVMaAeN+pQOIB6cL4gR3An2QCffYXg
2zIm5CkDxTlfFgt+dCS8cgc=
=0wgb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [mod_jk] problem serving URIs with 'special characters'

Posted by Guy Katz <gk...@allot.com>.
Hi;
Sorry for the beginner's question but does this means that I need to
compile mod_jk1.2.25 against my apache 2.0.52? Or can I still use the
1.2.25 from the tomcat connector downloads page as a drop-in
replacement.
Thanks.

-----Original Message-----
From: Mladen Turk [mailto:mladen.turk@gmail.com] 
Sent: Tuesday, August 28, 2007 8:22 AM
To: Tomcat Users List
Subject: Re: [mod_jk] problem serving URIs with 'special characters'

Guy Katz wrote:
> Thanks;
> one question though.
> The downloads page states that mod_jk1.2.25 is for apache 2.0.59 and
later only.
> i have a 2.0.52 installation(on centos) that i can't change. does this
mean i am stuck here? or can mod_jk1.2.25 still work with apache 2.0.52
> thanks in advance.
>
>   

Yes. It can work with 2.0.49 an up.
The notion is for produced binaries.

Regards,
Mladen


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [mod_jk] problem serving URIs with 'special characters'

Posted by Mladen Turk <ml...@gmail.com>.
Guy Katz wrote:
> Thanks;
> one question though.
> The downloads page states that mod_jk1.2.25 is for apache 2.0.59 and later only.
> i have a 2.0.52 installation(on centos) that i can't change. does this mean i am stuck here? or can mod_jk1.2.25 still work with apache 2.0.52
> thanks in advance.
>
>   

Yes. It can work with 2.0.49 an up.
The notion is for produced binaries.

Regards,
Mladen


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [mod_jk] problem serving URIs with 'special characters'

Posted by Guy Katz <gk...@allot.com>.
Thanks;
one question though.
The downloads page states that mod_jk1.2.25 is for apache 2.0.59 and later only.
i have a 2.0.52 installation(on centos) that i can't change. does this mean i am stuck here? or can mod_jk1.2.25 still work with apache 2.0.52
thanks in advance.


-----Original Message-----
From: Rainer Jung [mailto:rainer.jung@kippdata.de]
Sent: Sun 8/26/2007 11:33 PM
To: Tomcat Users List
Subject: Re: [mod_jk] problem serving URIs with 'special characters'
 
Guy Katz wrote:
> Hi; (using: centos, apache 2.0.52, mod_jk 1.2.21, tomcat 6)
> 
> Recently, I encountered a problem with URIs that has 'non western
> European' characters (for example:
> http://www.somehost.com/roller/admin/entry/nofx_%D7%91%D7%93%D7%A8%D7%9A
> ). I noticed that apache was forwarding to tomcat a different URI than
> the original which caused problems in my site.
> 
> Digging into the subject I found the JkOptions +ForwardURICompatUnparsed
> fixed my problem. However, I then encountered a different problem then.
> On the first hit, some images were not displayed in the browser (not
> served to it). So I checked the forums and found out about the
> JkStripSession. I figured it might help so I turned it on but nothing
> happened.

If you absolutely need to forward the original URI, you should set

JkOptions +JkForwardURIUnparsed

This has negative side effects:

- if you rewrite the URL via mod_rewrite, and then forward via mod_jk, 
mod_jk wil still forward the original URI, not the rewritten one

- the Tomcat AJP connector expects a session id that does not come via a 
cookie but via URL encoding as ";jsessionid=..." in the URI. It has to 
be a semicolon, not it's percent encoded equivalent.

The last jk 1.2.25 has a new forwarding policy. It reencodes everything 
that does not seem save, and that way tries to forward a URI that should 
fit into most cases- I would suggest you try that version without any 
JkOptions.

Also: with log level debug, it logs a line similar to:

[Sun Aug 26 01:12:03.482 2007] [27669:0] [debug]
init_ws_service::mod_jk.c (782): Service protocol=HTTP/1.1 method=GET
host=(null) addr=127.0.0.1 name=fraxinus.entenhausen.zz port=8080
auth=Basic user=jung laddr=127.0.0.1 raddr=127.0.0.1 uri=/auth.jsp

for every request. The line includes the URI exactly as it got forwarded 
to Tomcat, so you might be able to debug your problems more easily. The 
line exist also in the debug log of earlier versions, but for them does 
not include the uri.

> My questions are:
> 
> 1.	Should the JkStripSession help in this case? Was there a known
> bug in my apache/mod_jk versions related to this (couldn't find in
> bugzilla)?

JkStripSession is only important, if your static content gets served by 
Apache, but your webapp added URL encoded sessions to the links.

> 2.	How should I solve this? The only thing I need is to be able to
> forward URIs with 'special characters' as is to tomcat for a specific
> application (context)

Concerning the broken links: add an access log to Tomcat, check the 
request in the Apache access log, the Tomcat access log and the uri in 
the jk debug log to understand, what's wrong with those requests.

> I am really out of my element here so I would appreciate your help
> greatly.
> 
> Thanks in advance

Regards,

Rainer


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




Re: [mod_jk] problem serving URIs with 'special characters'

Posted by Rainer Jung <ra...@kippdata.de>.
Guy Katz wrote:
> Hi; (using: centos, apache 2.0.52, mod_jk 1.2.21, tomcat 6)
> 
> Recently, I encountered a problem with URIs that has 'non western
> European' characters (for example:
> http://www.somehost.com/roller/admin/entry/nofx_%D7%91%D7%93%D7%A8%D7%9A
> ). I noticed that apache was forwarding to tomcat a different URI than
> the original which caused problems in my site.
> 
> Digging into the subject I found the JkOptions +ForwardURICompatUnparsed
> fixed my problem. However, I then encountered a different problem then.
> On the first hit, some images were not displayed in the browser (not
> served to it). So I checked the forums and found out about the
> JkStripSession. I figured it might help so I turned it on but nothing
> happened.

If you absolutely need to forward the original URI, you should set

JkOptions +JkForwardURIUnparsed

This has negative side effects:

- if you rewrite the URL via mod_rewrite, and then forward via mod_jk, 
mod_jk wil still forward the original URI, not the rewritten one

- the Tomcat AJP connector expects a session id that does not come via a 
cookie but via URL encoding as ";jsessionid=..." in the URI. It has to 
be a semicolon, not it's percent encoded equivalent.

The last jk 1.2.25 has a new forwarding policy. It reencodes everything 
that does not seem save, and that way tries to forward a URI that should 
fit into most cases- I would suggest you try that version without any 
JkOptions.

Also: with log level debug, it logs a line similar to:

[Sun Aug 26 01:12:03.482 2007] [27669:0] [debug]
init_ws_service::mod_jk.c (782): Service protocol=HTTP/1.1 method=GET
host=(null) addr=127.0.0.1 name=fraxinus.entenhausen.zz port=8080
auth=Basic user=jung laddr=127.0.0.1 raddr=127.0.0.1 uri=/auth.jsp

for every request. The line includes the URI exactly as it got forwarded 
to Tomcat, so you might be able to debug your problems more easily. The 
line exist also in the debug log of earlier versions, but for them does 
not include the uri.

> My questions are:
> 
> 1.	Should the JkStripSession help in this case? Was there a known
> bug in my apache/mod_jk versions related to this (couldn't find in
> bugzilla)?

JkStripSession is only important, if your static content gets served by 
Apache, but your webapp added URL encoded sessions to the links.

> 2.	How should I solve this? The only thing I need is to be able to
> forward URIs with 'special characters' as is to tomcat for a specific
> application (context)

Concerning the broken links: add an access log to Tomcat, check the 
request in the Apache access log, the Tomcat access log and the uri in 
the jk debug log to understand, what's wrong with those requests.

> I am really out of my element here so I would appreciate your help
> greatly.
> 
> Thanks in advance

Regards,

Rainer


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org