problem with url encoding for apache server as load balancing server

problem with url encoding for apache server as load balancing server

am 13.02.2009 23:42:35 von rui fernandes

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 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: problem with url encoding for apache server as load balancing

am 16.02.2009 13:05:21 von rui fernandes

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 :
> 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 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: Re: problem with url encoding for apache server as

am 16.02.2009 13:35:15 von Eric Covener

On Mon, Feb 16, 2009 at 7:05 AM, rui fernandes 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 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: Re: problem with url encoding for apache server as

am 16.02.2009 13:54:44 von rui fernandes

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 :
> On Mon, Feb 16, 2009 at 7:05 AM, rui fernandes 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 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 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: Re: problem with url encoding for apache server as

am 16.02.2009 13:57:20 von rui fernandes

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 :
> 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 :
>> On Mon, Feb 16, 2009 at 7:05 AM, rui fernandes 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 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 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: Re: problem with url encoding for apache server as

am 16.02.2009 14:45:01 von Eric Covener

On Mon, Feb 16, 2009 at 7:57 AM, rui fernandes 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 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: Re: problem with url encoding for apache server as

am 16.02.2009 16:47:53 von rui fernandes

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=E9rida):

http://apacheserver/myapp?param=3DM%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=3DM%E9rida

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

http://tomcatA/myapp?param=3DM%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=3DM%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 :
> On Mon, Feb 16, 2009 at 7:57 AM, rui fernandes w=
rote:
>> 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 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
>
>



--=20
Un saludo,
Rui

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Re: problem with url encoding for apache server as

am 16.02.2009 19:26:13 von Eric Covener

On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes wr=
ote:
> Ok Eric,
>
> I have no logs to give you ( I really don't know what you want to be logg=
ed).
>
> I will give you an example (value M=E9rida):
>
> http://apacheserver/myapp?param=3DM%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=3DM%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.


--=20
Eric Covener
covener@gmail.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Re: problem with url encoding for apache server as

am 17.02.2009 08:32:41 von rui fernandes

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 :
> On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes =
wrote:
>> Ok Eric,
>>
>> I have no logs to give you ( I really don't know what you want to be log=
ged).
>>
>> I will give you an example (value M=E9rida):
>>
>> http://apacheserver/myapp?param=3DM%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=3DM%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 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
>
>



--=20
Un saludo,
Rui

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Re: problem with url encoding for apache server as

am 19.02.2009 17:37:30 von rui fernandes

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 :
> 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 :
>> On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes =
wrote:
>>> Ok Eric,
>>>
>>> I have no logs to give you ( I really don't know what you want to be lo=
gged).
>>>
>>> I will give you an example (value M=E9rida):
>>>
>>> http://apacheserver/myapp?param=3DM%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=3DM%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 Projec=
t.
>> See 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
>



--=20
Un saludo,
Rui

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Re: problem with url encoding for apache server as

am 19.02.2009 17:41:38 von rui fernandes

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+Tomc at%27s+URI+enco=
ding

2009/2/19 rui fernandes :
> 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 :
>> 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 :
>>> On Mon, Feb 16, 2009 at 10:47 AM, rui fernandes > wrote:
>>>> Ok Eric,
>>>>
>>>> I have no logs to give you ( I really don't know what you want to be l=
ogged).
>>>>
>>>> I will give you an example (value M=E9rida):
>>>>
>>>> http://apacheserver/myapp?param=3DM%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=3DM%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 Proje=
ct.
>>> See 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
>



--=20
Un saludo,
Rui

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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