You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by rui fernandes <rj...@gmail.com> on 2009/02/16 13:05:21 UTC

[users@httpd] Re: problem with url encoding for apache server as load balancing server

Hi,

Just in case people didn't paid attention to the first message, I was
hoping someone knew the answer to this simple apache (2.2)
configuration problem (uri encoding in utf-8 and not in iso..).

Thanks,
Rui

2009/2/13 rui fernandes <rj...@gmail.com>:
> I have a Tomcat cluster with an Apache Server as load balancing
> server. Every server (Tomcat cluster nodes) and apache runs on
> Windows. Everything works fine except for url encoding problems. My
> Tomcat nodes expect UTF-8 URL encoding which is ok. But the Apache
> server expects ISO 8859-1 url encoding. I wanted to configure the
> apache server so I can call my tomcats through the apache balancing
> server with urls utf-8 encoded just as I did before clustering all. I
> tried to configure httpd.conf with AddDefaultCharset with
> IndexOptions, and nothing.... my Apache keeps expecting ISO-8859-1
> encoded urls. Please, does anynone knows this problem and how to solve
> it?
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by rui fernandes <rj...@gmail.com>.
Ok you did not gave me any urls... I thought so, but it was google who
gave based on your indications:

http://confluence.atlassian.com/display/DOC/Configuring+Tomcat%27s+URI+encoding

2009/2/19 rui fernandes <rj...@gmail.com>:
> Thanks Eric.
>
> By reading the info urls you gave I was able to identify the problem.
> It was just a matter of setting apache to disable url parsing since I
> want it as a clean simple load balance server. Just had to comment the
> original line and set it as unparsed according:
>
> #JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
> JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
>
>
> Thanks again,
> Rui
>
> 2009/2/17 rui fernandes <rj...@gmail.com>:
>> Hi Eric,
>>
>> I read the doc and doesn't look bad. I'll give a try and tell you
>> about after. Many thanks.
>>
>> Rui
>>
>> 2009/2/16 Eric Covener <co...@gmail.com>:
>>> On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes <rj...@gmail.com> wrote:
>>>> Ok Eric,
>>>>
>>>> I have no logs to give you ( I really don't know what you want to be logged).
>>>>
>>>> I will give you an example (value Mérida):
>>>>
>>>> http://apacheserver/myapp?param=M%C3%A9rida
>>>>
>>>> (UTF-8 url encoded) Goes bad! (I don't want to go bad). Meaning bad
>>>> that the tomcat cluster translates into wrong/strange characters.
>>>>
>>>> http://apacheserver/myapp?param=M%E9rida
>>>>
>>>> (ISO88591) Goes ok! But that it's not what I want since I want to
>>>> encode in utf-8.
>>>
>>>
>>> Look at the jkoptions that talk about URI encoding, or pre-encode your
>>> links, or figure out how to coerce browsers into generating the query
>>> string you want reliably.
>>>
>>>
>>> --
>>> Eric Covener
>>> covener@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> The official User-To-User support forum of the Apache HTTP Server Project.
>>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Un saludo,
>> Rui
>>
>
>
>
> --
> Un saludo,
> Rui
>



-- 
Un saludo,
Rui

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by rui fernandes <rj...@gmail.com>.
Thanks Eric.

By reading the info urls you gave I was able to identify the problem.
It was just a matter of setting apache to disable url parsing since I
want it as a clean simple load balance server. Just had to comment the
original line and set it as unparsed according:

#JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories


Thanks again,
Rui

2009/2/17 rui fernandes <rj...@gmail.com>:
> Hi Eric,
>
> I read the doc and doesn't look bad. I'll give a try and tell you
> about after. Many thanks.
>
> Rui
>
> 2009/2/16 Eric Covener <co...@gmail.com>:
>> On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes <rj...@gmail.com> wrote:
>>> Ok Eric,
>>>
>>> I have no logs to give you ( I really don't know what you want to be logged).
>>>
>>> I will give you an example (value Mérida):
>>>
>>> http://apacheserver/myapp?param=M%C3%A9rida
>>>
>>> (UTF-8 url encoded) Goes bad! (I don't want to go bad). Meaning bad
>>> that the tomcat cluster translates into wrong/strange characters.
>>>
>>> http://apacheserver/myapp?param=M%E9rida
>>>
>>> (ISO88591) Goes ok! But that it's not what I want since I want to
>>> encode in utf-8.
>>
>>
>> Look at the jkoptions that talk about URI encoding, or pre-encode your
>> links, or figure out how to coerce browsers into generating the query
>> string you want reliably.
>>
>>
>> --
>> Eric Covener
>> covener@gmail.com
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>
>
> --
> Un saludo,
> Rui
>



-- 
Un saludo,
Rui

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by rui fernandes <rj...@gmail.com>.
Hi Eric,

I read the doc and doesn't look bad. I'll give a try and tell you
about after. Many thanks.

Rui

2009/2/16 Eric Covener <co...@gmail.com>:
> On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes <rj...@gmail.com> wrote:
>> Ok Eric,
>>
>> I have no logs to give you ( I really don't know what you want to be logged).
>>
>> I will give you an example (value Mérida):
>>
>> http://apacheserver/myapp?param=M%C3%A9rida
>>
>> (UTF-8 url encoded) Goes bad! (I don't want to go bad). Meaning bad
>> that the tomcat cluster translates into wrong/strange characters.
>>
>> http://apacheserver/myapp?param=M%E9rida
>>
>> (ISO88591) Goes ok! But that it's not what I want since I want to
>> encode in utf-8.
>
>
> Look at the jkoptions that talk about URI encoding, or pre-encode your
> links, or figure out how to coerce browsers into generating the query
> string you want reliably.
>
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



-- 
Un saludo,
Rui

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by Eric Covener <co...@gmail.com>.
On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes <rj...@gmail.com> wrote:
> Ok Eric,
>
> I have no logs to give you ( I really don't know what you want to be logged).
>
> I will give you an example (value Mérida):
>
> http://apacheserver/myapp?param=M%C3%A9rida
>
> (UTF-8 url encoded) Goes bad! (I don't want to go bad). Meaning bad
> that the tomcat cluster translates into wrong/strange characters.
>
> http://apacheserver/myapp?param=M%E9rida
>
> (ISO88591) Goes ok! But that it's not what I want since I want to
> encode in utf-8.


Look at the jkoptions that talk about URI encoding, or pre-encode your
links, or figure out how to coerce browsers into generating the query
string you want reliably.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by rui fernandes <rj...@gmail.com>.
Ok Eric,

I have no logs to give you ( I really don't know what you want to be logged).

I will give you an example (value Mérida):

http://apacheserver/myapp?param=M%C3%A9rida

(UTF-8 url encoded) Goes bad! (I don't want to go bad). Meaning bad
that the tomcat cluster translates into wrong/strange characters.

http://apacheserver/myapp?param=M%E9rida

(ISO88591) Goes ok! But that it's not what I want since I want to
encode in utf-8.

http://tomcatA/myapp?param=M%E9rida

(ISO88591) Goes bad! But that's ok cause I don't want no one (apache
or tomcat nodes) to handle iso8591 encodings on url.

http://tomcatA/myapp?param=M%C3%A9rida

(UTF8) Goes ok! And that's ok, cause I want everyone (apache and
tomcat nodes) to handle utf-8 encodings on url.

Please Erik tell me if it's still not clear what's going on. Apache
2.2 Simple load balancing (for the tomcat nodes) with mod_jk, no
special httpd.conf besides the normal worker configuration for load
balancing. Do you recongnize my problem? Do you think it has a
solution?

2009/2/16 Eric Covener <co...@gmail.com>:
> On Mon, Feb 16, 2009 at 7:57 AM, rui fernandes <rj...@gmail.com> wrote:
>> in schema:
>>
>> me -- url with values encoded in utf-8 --> tomcat nodes  (ok)
>> me -- url with values encoded in iso... --> apache ---> tomcat nodes (ok)
>> me -- url with values encoded in utf8 ---> apache --> tomcat nodes (bad)
>>
>> I want this last one to be ok!
>>
>> any ideas?
>
> I still don't see any logs, example URLs, or a clear indication of
> what happens when you receive a utf-8 encoded query string.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



-- 
Un saludo,
Rui

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by Eric Covener <co...@gmail.com>.
On Mon, Feb 16, 2009 at 7:57 AM, rui fernandes <rj...@gmail.com> wrote:
> in schema:
>
> me -- url with values encoded in utf-8 --> tomcat nodes  (ok)
> me -- url with values encoded in iso... --> apache ---> tomcat nodes (ok)
> me -- url with values encoded in utf8 ---> apache --> tomcat nodes (bad)
>
> I want this last one to be ok!
>
> any ideas?

I still don't see any logs, example URLs, or a clear indication of
what happens when you receive a utf-8 encoded query string.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by rui fernandes <rj...@gmail.com>.
in schema:

me -- url with values encoded in utf-8 --> tomcat nodes  (ok)
me -- url with values encoded in iso... --> apache ---> tomcat nodes (ok)
me -- url with values encoded in utf8 ---> apache --> tomcat nodes (bad)

I want this last one to be ok!

any ideas?

2009/2/16 rui fernandes <rj...@gmail.com>:
> Hi Eric,
>
> Thanks for the answer. I am using mod_jk and redirecting everything to
> be handled by the tomcat remote servers (apache 2.2 is purely doing
> load balancing for the two tomcat nodes of the cluster).
>
> If I call directly my tomcat cluster nodes I have to call with values
> url encoded in utf-8 which is ok.
>
> If I encode the parameter values in a url (for example myvalue in
> http://myapacheserver/mywebapp?myparam=myvalue_url_encoded)  in
> iso8859-1 then the request arrives at my tomcat cluster nodes properly
> (utf8 url encoded).
>
> If I make the requests to the apache load balancing server in utf-8
> (that's what I want) then the request is not properly forwarded by
> apache to the tomcat nodes (the values arrive with bad charset
> encoding...).
>
> I want any remote client (user or app) to access the apache load
> balancing server or the tomcat cluster nodes directly in a
> transaparent way. With the same url encoding: utf-8.
>
> I read that Apache by default expects iso8859-1, and I already tried
> to configure in the usual way with adddefaultcharset, indexoptions and
> so. I thought this was a normal issue with apache with a more or less
> straightforward answer... guess I am wrong. I don't think the fact
> apache is doing load balancing through moid_jk to a tomcat cluster
> should be very important (thought i can be wrong). I would think this
> is just a httpd.conf problem.
>
> I hope this extra information helps you or anyone to give me a clue on
> how to solve this.
>
> Best,
> rui.
>
>
> 2009/2/16 Eric Covener <co...@gmail.com>:
>> On Mon, Feb 16, 2009 at 7:05 AM, rui fernandes <rj...@gmail.com> wrote:
>>> Hi,
>>>
>>> Just in case people didn't paid attention to the first message, I was
>>> hoping someone knew the answer to this simple apache (2.2)
>>> configuration problem (uri encoding in utf-8 and not in iso..).
>>
>> It's not simple.  IMO It didn't include enough rigorous information
>> for anyone to comment on.
>>
>> Were you using mod_jk before you added balancer or mod_proxy_ajp?
>> What's your current and previous configuration?
>>
>> What does it mean for apache to "expect" ISO8859-1?
>>
>> Figure out byte-for-byte what the browser requests and what is
>> requested by your connector module, and include the information.
>>
>> --
>> Eric Covener
>> covener@gmail.com
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>
>
> --
> Un saludo,
> Rui
>



-- 
Un saludo,
Rui

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by rui fernandes <rj...@gmail.com>.
Hi Eric,

Thanks for the answer. I am using mod_jk and redirecting everything to
be handled by the tomcat remote servers (apache 2.2 is purely doing
load balancing for the two tomcat nodes of the cluster).

If I call directly my tomcat cluster nodes I have to call with values
url encoded in utf-8 which is ok.

If I encode the parameter values in a url (for example myvalue in
http://myapacheserver/mywebapp?myparam=myvalue_url_encoded)  in
iso8859-1 then the request arrives at my tomcat cluster nodes properly
(utf8 url encoded).

If I make the requests to the apache load balancing server in utf-8
(that's what I want) then the request is not properly forwarded by
apache to the tomcat nodes (the values arrive with bad charset
encoding...).

I want any remote client (user or app) to access the apache load
balancing server or the tomcat cluster nodes directly in a
transaparent way. With the same url encoding: utf-8.

I read that Apache by default expects iso8859-1, and I already tried
to configure in the usual way with adddefaultcharset, indexoptions and
so. I thought this was a normal issue with apache with a more or less
straightforward answer... guess I am wrong. I don't think the fact
apache is doing load balancing through moid_jk to a tomcat cluster
should be very important (thought i can be wrong). I would think this
is just a httpd.conf problem.

I hope this extra information helps you or anyone to give me a clue on
how to solve this.

Best,
rui.


2009/2/16 Eric Covener <co...@gmail.com>:
> On Mon, Feb 16, 2009 at 7:05 AM, rui fernandes <rj...@gmail.com> wrote:
>> Hi,
>>
>> Just in case people didn't paid attention to the first message, I was
>> hoping someone knew the answer to this simple apache (2.2)
>> configuration problem (uri encoding in utf-8 and not in iso..).
>
> It's not simple.  IMO It didn't include enough rigorous information
> for anyone to comment on.
>
> Were you using mod_jk before you added balancer or mod_proxy_ajp?
> What's your current and previous configuration?
>
> What does it mean for apache to "expect" ISO8859-1?
>
> Figure out byte-for-byte what the browser requests and what is
> requested by your connector module, and include the information.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



-- 
Un saludo,
Rui

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: problem with url encoding for apache server as load balancing server

Posted by Eric Covener <co...@gmail.com>.
On Mon, Feb 16, 2009 at 7:05 AM, rui fernandes <rj...@gmail.com> wrote:
> Hi,
>
> Just in case people didn't paid attention to the first message, I was
> hoping someone knew the answer to this simple apache (2.2)
> configuration problem (uri encoding in utf-8 and not in iso..).

It's not simple.  IMO It didn't include enough rigorous information
for anyone to comment on.

Were you using mod_jk before you added balancer or mod_proxy_ajp?
What's your current and previous configuration?

What does it mean for apache to "expect" ISO8859-1?

Figure out byte-for-byte what the browser requests and what is
requested by your connector module, and include the information.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org