--- a/modules/fcgid/fcgid_bridge.c 2013-06-07 14:44:23.000000000 +1000 +++ a/modules/fcgid/fcgid_bridge.c 2013-06-07 14:51:23.000000000 +1000 @@ -580,6 +580,18 @@ "temporary file"); return HTTP_INTERNAL_SERVER_ERROR; } + /* The version of APR bundled width Apache 2.2.3 as used in */ + /* RHEL/CentOS 5 doesn't properly seek in apr_file_trunc */ + /* so do it manually, worst case should be a redundant lseek */ + /* and if we don't we break Keep-Alive POSTs that are larger */ + /* than FcgidMaxRequestInMem on RHEL/CentOS 5.x */ + apr_off_t zero = 0; + if (rv = apr_file_seek(fd, SEEK_SET, &zero) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, + "mod_fcgid: can't seek to start of " + "temporary file"); + return HTTP_INTERNAL_SERVER_ERROR; + } } }