Ubuntu 16.04-Apache 2.4.18-请求URI太长 [英] Ubuntu 16.04 - Apache 2.4.18 - Request-URI Too Long

查看:283
本文介绍了Ubuntu 16.04-Apache 2.4.18-请求URI太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Google图片搜索结果中保存图片,但是当我在查询字符串参数中发送图片的src时,出现以下错误:

I am trying to save an image from Google Images search result but when I send the image's src in the query string parameter it gives the following error:

Request-URI Too Long 
The requested URL's length exceeds the capacity limit for this server.

Apache/2.4.18 (Ubuntu) Server at 127.0.1.1 Port 80

当我在本地计算机上收到此错误时,我有可能测试大家都知道的任何想法.

As I am getting this error on my local machine, it is possible for me to test any ideas you all got.

注意:我确实在/etc/apache2/apache2.conf文件中将LimitRequestLineLimitRequestFieldSize设置为100000.但是到目前为止还没有运气.

Note: I did set the LimitRequestLine and LimitRequestFieldSize to 100000 in the /etc/apache2/apache2.conf file. But no luck so far.

感谢您的帮助.

推荐答案

请求参数不能具有无限长.我的猜测是,在将图像src作为查询参数发送时,您达到了最大长度.

Request parameters cannot have an infinite length. My guess is that you reached the maximum length when sending the image src as a query parameter.

来自此处的答案:您似乎可以将LimitRequestLineLimitRequestFieldSize设置为最大8192字节或任何低于(但不高于)该值的东西.

From this answer here it seems like you can set LimitRequestLine and LimitRequestFieldSize to a maximum of 8192 bytes or anything below (so not above) that value.

在Apache中,如果您将其用作网络服务器,则可以将其限制为默认的8190字节以下,但不能超过其默认值,而无需更改源代码&重新编译.

And in Apache, if you use that as a webservers, you can limit it to something below the default 8190 bytes, but not to something above it without changing the source code & recompiling.

也请阅读此问题其中包含有关网址最大长度的更多信息:

Read also this question which has lots of more information on the maximum length of your url:

这是一个很受欢迎的问题,由于原始研究已有9年的历史,我将尝试使其保持最新:截至2016年11月,该建议仍然有效.即使IE11可能接受更长的URL,但较旧的IE安装的普遍存在以及搜索引擎的限制意味着,最好将一般字符限制在2000个字符以内.

This is a popular question, and as the original research is ~9 years old I'll try to keep it up to date: As of Nov 2016, the advice still stands. Even though IE11 may possibly accept longer URLs, the ubiquity of older IE installations plus the search engine limitations mean staying under 2000 chars is the best general policy.

换句话说:尝试保持在2000个字符以下,并使用POST发送大量数据...

In other words: try to stay under 2000 chars and use POST for sending large amounts of data...

这篇关于Ubuntu 16.04-Apache 2.4.18-请求URI太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆