413 request entity too large apache “tomcat”

牧云@^-^@ 提交于 2021-02-10 18:57:49

问题


User when access BOBJ tomcat URL the AD SSO works without any issues, when the user tries to access the Apache load balancer, then we get the Request entity too large error message. This is happening for few of the users and few of them can login without any issues.

Setup: configured Apache Load Balancer - to connect to two tomcat server via Workers.properties.

BOBJ AD SSO is configured on Tomcat server

Error :Request Entity Too Large The requested resource /BOE/portal/1712062105/BIPCoreWeb/VintelaServlet does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

Configuration on

Apache Httpd: LimitRequestLine 65536 LimitRequestBody 0 LimitRequestFieldSize 65536 LimitRequestFields 10000 ProxyIOBufferSize 65536 worker: worker.ajp13.max_packet_size=65536

Tomcat:

Request someone to help in troubleshooting the error.


回答1:


Possible solution!

Apache tomcat:

1.  modify /opt/ tomcat/config/server.xml 
    <Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443"
                   maxPostSize="209715200" 
                   disableUploadTimeout="true" 
                   maxHttpHeaderSize="1006384" />

2.  modify  /tomcat/webapps/manager/WEBINFO/web.xml

       <multipart-config>
      <!-- 50MB max -->
      <max-file-size>104857600</max-file-size>
      <max-request-size>209715200</max-request-size>
      <file-size-threshold>0</file-size-threshold>
    </multipart-config>

Nginx:

1.  modify /etc/nginx/nginx.conf
2.  add this  " client_max_body_size 200M; " 

http{
client_max_body_size 200M; 
}

*  Restart tomcat server
  sudo systemctl restart tomcat
*  Restart nginx server
  sudo systemctl restart nginx



回答2:


The issue here is with the Apache parameter under Worker.properties file

We initial have set this to -> worker.ajp13.max_packet_size="65536"

However the syntax should be this : worker..max_packet_size="65536”

Your site is basically the tomcat site which we refereed as worker1 and worker2. Once we changed that value to below

worker: worker1.max_packet_size="65536"

This issue got fixed.

Hope this helps for users who have configure Apache as load balancer to two or more tomcat web application clusters.




回答3:


Similar issue for me, but the fix was slightly different:

worker.ajp13.max_packet_size=65536

This was actually in: path/apache2/conf/extra/workers.properties (probably just a typo in earlier answer)




回答4:


I'm not 100% certain this will resolve your issue, but it seems to be related. In Tomcat's server.xml, add the following to Connector: maxHttpHeaderSize="65536". The whole line should look something like:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" 
redirectPort="8443" compression="on" URIEncoding="UTF-8" compressionMinSize="2048" 
noCompressionUserAgents="gozilla, traviata" 
compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,text/json,application/json" 
maxHttpHeaderSize="65536" />


来源:https://stackoverflow.com/questions/51390755/413-request-entity-too-large-apache-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!