What is the maximum length of a URL in apache? Where is it documented, and is it configurable?
I'm implementing an openid identity provider, and would like to know the limitations I'm up against. I know about the 2048 byte path limit on Internet Explorer. That can be handled specially using user agent detection. Other browsers have much higher URL limits.
So what I'm interested in is apache server limits when coding an application.
Here's a bash script to check the maximum limit of a remote server (uses curl and perl).
You just need some kind of an url that can be extended with 'x' and always return 200 (or adapt it to your needs). At some point it will break and the script will display the max length.
Here's the code:
From: http://www.danrigsby.com/blog/index.php/2008/06/17/rest-and-max-url-size/
The default limit for the length of the request line is 8192 bytes = 8* 1024. It you want to change the limit, you have to add or update in your tomcat server.xml the attribut maxHttpHeaderSize.
as:
In this example I set the limite to 65536 bytes= 64*1024.
Hope this will help.
The official length according to the offical Apache docs is 8,192, but many folks have run into trouble at ~4,000.
MS Internet Explorer is usually the limiting factor anyway, as it caps the maximum URL size at 2,048.
Allowed default size of URI is 8177 characters in GET request. Simple code in python for such testing.
On 8178 characters you will get such message: HTTP/1.1 414 Request-URI Too Large
The default limit for the length of the request line is 8190 bytes (see
LimitRequestLine
directive). And if we subtract three bytes for the request method (i.e.GET
), eight bytes for the version information (i.e.HTTP/1.0
/HTTP/1.1
) and two bytes for the separating space, we end up with 8177 bytes for the URI path plus query.