how to increase Apache 2 uri length limit

Open /etc/apache2/apache2.conf

and insert under AccessFileName .htaccess:

LimitRequestLine 1000000
LimitRequestFieldSize 1000000

The best answer is "don't do that". See https://boutell.com/newfaq/misc/urllength.html (link goes to Internet Archive backup) for an explanation of why.

If you need to pass that much data, use POST, not GET.


You would have to set DEFAULT_LIMIT_REQUEST_LINE constant inside of the Apache source code, and recompile Apache. This constant is in the httpd.h header file.

After this is done you can decrease request limit using the LimitRequestLine directive.

See the http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestline for more info.


A quick hack to get it working you just edit the apache2.conf file and add the line:

LimitRequestLine 100000

Restart apache and you are all good. Although you should change the code to use POST instead of GET and remove the line as soon as you can.

Tags:

Apache2