Request entity too large 413 apache tomcat - apache

Request entity too large
The requested resource
/some/url/path/on/server
does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit.
I get a corresponding error in my mod_jk.log file which is below.
[Mon Oct 10 20:36:11 2011] [9834:0] [error] ajp_marshal_into_msgb::jk_ajp_common
.c (415): failed appending the header value
I have a web farm running tomcat5, fronted by apache1.3 using the mod_jk connector. I started getting this error today on all the servers although no code changes were made today. The error seems to popup randomly. The same request doesn't always generate the error.
Can anyone explain the cause and why it would be random? I have seen recommendations to increase max_packet_size in server.xml. I want to understand the problem and the impact of the change before making it.

Related

Undefined Apache server error rdbmmap

Since few days I've got the following error message in my Server error log :
www.xxx.com [client XXX.XXX.XXX.XXX] rdbmmap (21): rdbm_fetch failed (1)
Although the site is loading right. I would like to know about this error. Can't find anything around. Does anybody know about this?
Server configuration :
Server-Info: Apache/2.2.31 (Unix)
PHP-Version: 7.1.8
WordPress: 4.8.1
MySQL-Version: 5.6.37
Thanks in advance.
Please have a look at this: Map Reduce & RDBMS
RDBMS - stands for Remote database management system,
Client- is the browser,oder crawler bot ,that send the Request.
Fetch Failed- means, the system could fetch the request to the database.

Centos server hanged due to postfix/sendmail spam emails

My centos server is running web applications in LAMP stack. A couple of days back, the server was not responding for about 10 mins and I got http response failure alert from my monitoring tool. When I checked the httpd error log I found a huge log entry (~12000 lines) related to sendmail.
14585 sendmail: fatal: open /etc/postfix/main.cf: Permission denied
The server ran out of memory and not responding.
14534 [Fri Aug 19 22:14:52.597047 2016] [mpm_prefork:error] [pid 26641] (12)Cannot allocate memory: AH00159: fork: Unable to fork new process
14586 /usr/sbin/sendmail: error while loading shared libraries: /lib64/librt.so.1: cannot allocate version reference table: Cannot allocate memory
We are not using sendmail in any of our application. How can I stop this attack in future?
Thank you in advance!
Sorry I have no comment facilities; it looks like one of your website pages is vulnarable for code injection, finding out where and what page may be a huge job. Focus on input (forms) variables. Always sanitize input variables before using them! P.s. php uses "sendmail", even if you use Postfix, it will use a sendmail binary to send mail and the sendmail binary will redirect it to Postfix. If your forms work well and the 12k error log lines come out of the blue, then I would think someone is trying to inject code through your website (happens all the time by the way).

FineUploader Exception : XhrReadyState=0 and XhrResponseStatus=0

We're experiencing FineUploader exceptions with XhrReadyState=0 and XhrResponseStatus=0 on 5.4.1 in our production environment intermittently across browsers. We've checked out our CORS configuration for our S3 bucket and we do have the wild card origin header set.
Access-Control-Allow-Origin: *
Was looking at FineUploader CORS selectively working, and we do not set the sendCredentials value in our configuration.
Error from fine uploader is
XHR returned response code 0
The XHR response object contains the following values,
XhrReadyState=0
XhrResponseText=empty
XhrResponseType=empty
XhrResponseStatus=0
XhrTimeout=0
XhrAllResponseHeaders=empty
Update 1
So we captured a repro of this. It looks like one of our OPTIONS requests is getting a 403 randomly in the middle of the upload.
[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (a7db116d-26ec-4b45-9566-8697d42a7b4c.VOB, line 0)
[Error] Failed to load resource: Origin http://www.ourdomain.com is not allowed by Access-Control-Allow-Origin. (a7db116d-26ec-4b45-9566-8697d42a7b4c.VOB, line 0)
[Error] XMLHttpRequest cannot load http://ourbucket.s3.amazonaws.com/....
Origin http://www.ourdomain.com is not allowed by Access-Control-Allow-Origin.
Here is the screen grab from the Safari console. I was suspecting a network problem, but I wouldn't expect such a quick 403 response if a network issue was . Also, previous OPTIONS requests had just succeeded before and after the one that 403'd. We have configured CORS on our S3 bucket.
Status 0 indicates some issue either with your server or with the network. More specifically, it indicates that the response received was completely empty. This can be caused by CORS issues or even a temporary network issue. You'll want to examine these possibilities further in order to determine what is causing the issue for you.

Apache custom dynamic error response

I've seen hundreds of pages explaining how to create custom error pages in Apache 2 server. My question is different. I have a web application running in Apache (it is a ISAPI DLL, but it could also be a CGI executable). My application can handle internal server errors and generate a detailed error message (for instance, include a full stack trace), included in the response together with error code 500. AFAIK, Apache just let me use redirection in order to display custom error messages: http://httpd.apache.org/docs/2.2/custom-error.html
HTTP spec (RFC 2616 - section 10), not only allows but also recommend that detailed error message should be included in the BODY section of the response in case of error code > 500.
Link: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5
Seems that Apache won't let my custom error message go to the browser, and always replace it with its own internal error message and I believe that it is not the correct behavior, based on RFC 2616.
So my question is: Is there any setting in Apache server that will let my custom message go to the browser? Or, is there anything that can be done in my application that will instruct Apache to send my custom error message (something like some specific header field in the response)?
More on the subject:
When my ISAPI application returns error code 500, with other error information in the response body, Apache replaces it with its standard "500 Internal Server Error" message/HTML content, and inside Error.log file I can see the "useless" "Premature end of script headers" message. I'm deeply sure that my headers are fine, including the Content-Type field.
If I replace the 500 error code with any other server error code (e.g. 501) it works flawlessly and my response goes to the browser as is. The same header is sent to the Apache server, only the error code is different (501, instead of 500). With this test result in mind, one of these two must be true:
1- Apache requires some specific header field when status code is 500
2- Apache won't let custom error messages with status code 500 go to the browser.
I don't see any other alternative.
I think you're conflating two questions. You can generate a 500 response with a CGI script and include your custom body. Or you can override any 500 with any resource you want.
If you're failing to do the former, it's likely because of some subtle thing in the ISAPI interface between Apache and your module. Desk-checking the code says you should be able either set the pseudo
Status: 500
Header, or basically return any ISAPI error and end up with a 500 and your custom body.
Apache has two notions of a status code -- the one in the status line (r->status) and an error code returned separately from the module that handles the request (return HTTP_INTERNAL_SERVER_ERROR, return r->status).
When the former is used as the latter is when the custom error messages get lost. All of that happens in./modules/arch/win32/mod_isapi.c in Apache. Whatever is going on, it is ISAPI unique.

Apache upload failed when file size is over 100k

Below it is some information about my problem.
Our Apache2.2 is on windows 2008 server.
Basically the problem is user fails to upload file which is bigger than 100k to our server.
The error in Apache log is: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. : Error reading request entity data, referer: ......
There were a few times (not always) I could upload larger files(100k-800k, failed for 20m) in Chrome. In FF4 it always fails for uploading file over 100k. In IE8 it is similar to FF4.
It seems that it fails to get request from client, then I reset TimeOut in Apache setting to default value(300) which did not help at all.
I do not have the RequestLimitBody option set up and I am not using PHP. Anyone saw the similar error before? Now I am not sure what I can try next. Any advise would be appreciated!
Edit:
I just tried to use remote desk to upload files on the server and it worked fine. First thought was about the firewall which however is off all the time, Http Proxy is applied though.