Config for mod_fcgid related to maxrequestlen and timeout

sdanf

Member
Jun 7, 2011
5
0
51
I have mod_fcgid enabled and receive the following errors when trying to post to my site using xmlrpc, however the error has popped up a few times in other areas as well.

Running on centos 5.

Code:
mod_fcgid: read data timeout in 40 seconds
as well as

Code:
mod_fcgid: HTTP request length 131385 (so far) exceeds MaxRequestLen (131072)
I could not find a mod_fcgid.conf file anywhere so I created one in /usr/local/apache/conf/includes/ and added an include line to my main httpd.conf file

Inside I added:

Code:
<IfModule mod_fcgid.c>
MaxRequestLen 1000000000
IPCConnectTimeout 100
IPCCommTimeout 1000
</IfModule>
Is this the correct place to put it, and how can I confirm 100% that these limits are being applied as the error was happening at random.

Thanks
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
somewhere over the rainbow
cPanel Access Level
Root Administrator
I would suggest putting the include into /usr/local/apache/conf/includes/pre_main_global.conf instead of creating a new include. If you directly edit httpd.conf to add an include line, Apache rebuild or recompile will wipe that include line. The existing includes in /usr/local/apache/conf/includes directory will be automatically added if you simply distill them using:

Code:
/usr/local/cpanel/bin/apache_conf_distiller --update
At that point, then rebuild Apache and restart it:

Code:
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart
 

kbob

Member
May 30, 2011
17
0
51
cPanel Access Level
Root Administrator
@sdanf i would say a more normal place for this would be :

/usr/local/apache/conf/conf.d/mod_fcgid.conf
Or otherwise if you are running the server with a main configuration of PHP mod_fcgi + SuExec :

/usr/local/apache/conf/php.conf
Is also a place to put these configuration changes.

As for the error you provided initially :

mod_fcgid: read data timeout in 40 seconds
I have seen this to be caused by the fact that the script being executed requires more memory to finish up whatever it is currently executing, otherwise the site hits a Error 500 Internal server.

Hope this can help you.
 

cavamondo

Member
May 21, 2011
23
0
51
This fixed the issue about uploading filesize for me: MaxRequestLen setting for mod_fcgid to a higher value.

WHM > Apache Configuration > Include Editor > Post VirtualHost Include > All

We added this (mod_fcgid version 2.35):

<IfModule mod_fcgid.c>
MaxRequestLen 1000000000
</IfModule>

For mod_fcgid version 2.36, add this:

<IfModule mod_fcgid.c>
FcgidMaxRequestLen 1000000000
</IfModule>