- Log in to post comments
For no special reason Drupal sites on our server (CentOS 5 with cPanel/WHM) started to make problems with file upload. Because Drupal 6/7 has use Ajax for file uploading the only thing that happens is that browser just hangs until timing out. Quick playing with different file sizes revealed that files that are less then 100kb are OK, but bigger files are creating problem. Of course php post_max_size and upload_max_filesize are set to 20mb so that was not causing problems. Strange...
Actually the biggest problem here was finding out what the hell is happening. I quickly created small html/php script with file upload form, and when testing with files bigger then 100kb I immediately got 500 internal server error - OK, that is something but still not telling much. Most annoying thing was fact that php error_log and apache logs that I was getting from Cpanel and WHM were error empty.
Yes in CentOS (managed with cPanel) you have logs all over the place. Finally founded master apache log that I needed and there was explanation
[Fri Jul 08 12:36:14 2011] [warn] [client 91.182.145.210] mod_fcgid: HTTP request length 132356 (so far) exceeds MaxRequestLen (131072), referer: http://www.montenasoft.com/.../upload.html
So MaxRequestLen from mod_fcgid (and we are running fast cgi for PHP) is limiting request length to only 130kb - If the size of the request body exceeds this amount, the request will fail with 500 Server Error. Fix is easy you just need to add in your httpd.conf next lines
# Work around annoying fcgid limitations <ifmodule mod_fcgid.c> # 20MB should be enough MaxRequestLen 20000000 </ifmodule>
But again when you have WHM for server management things are not that easy ;) You can not just add those lines to /etc/httpd/conf/httpd.conf because next time when you update apache or php on your server your custom httpd.conf tweaks will be lost.
Here is a correct way to do, login to WHM and go to "Apache Configuration", and then select "Include Editor"
Then in "Pre VirtualHost Include" section select "All versions" add custom MaxRequestLen configuration, and hit update.
And don't forget to restart apache on the end.
And that was it, no more 500 internal server error. Why this setting started to make problem recently is still unknown, maybe cPanel auto updates changed something silently.
Comments
Lifesaver!
This was a lifesaver! Thanks so much. I recently moved to a new VPS with WHM/cPanel CentOS, I never had this problem before on my previous server. Have spent several hours reading about people digging through system files and editing conf files, and all along the solution was in WHM.
Thanks for the heads up! Now I can get on with some work....
Ted
Man, You are simply the best,
Man, You are simply the best, thanks a lot!
i am using Godaddy
Can you help me to edit apace Configuration files. i am using godaddy server. and i could not find apace configuration in their control panel. please help me where it will placed to do these changes.
THnaks and waiting...
Sorry but I never used
That's exactly what fixed my
That's exactly what fixed my problem in my dedicated server, great article (Y)
Can I buy you a beer over the internet?
Thanks a tonne man! You really saved my ass with this blogpost :)
Thank you
Add my "thank you" to the list!!
Thanks a bunch for this posting! I was working on a customer's Plesk site, and this was exactly the problem (even with the same symptoms, such as the cryptic and annoying empty log files!).
I believe you saved me much work, and I am very grateful!
Just FYI, this customer just upgraded their Plesk about 2 weeks ago, so this was probably the culprit. Thanks again! Surf Wisely.
Thank you so much!
We had this problem and I was rummaging around trying to find config files to edit, but this worked perfectly! One very happy bunny!
Ruth
Sorted out my new VPS
Thanks for this post, saved me a lot of head scratching for sure! Sorted out my new VPS,
Thank you for the tip!
Awesome, thank you very much for those published details, save me a ton of research :)
Thank you so much! I didn't
Thank you so much! I didn't search that long to fix the problem. But just because I found this awesome solution fast as hell. Thank you!
FcgidMaxRequestLen is 1 Gb
Hello,
I run a Joomla website and I get those 500 internal server errors. I checked on WHM and I have "FcgidMaxRequestLen 1073741824" (1Gb) but no use. Can you please indicate me another solution?
Thanks
This one worked
I also had this one in my localhost.
thnaks.
Thanks a lot! This fix
Thanks a lot! This fix finalized my headache that lasted one week!
thx 4 this post mate. Very
thx 4 this post mate. Very help full 4 me. ;)
Thanks so much!
I just moved my site to a new server and had this same error when installing joomla extensions . Thanks so much for the easy fix!
Thanks!!!
That's exactly what i was looking for... Thank you so much for posting...
For ISPconfig and Apache2 setup
Hi,
A good solid week I have been looking for this answer! Thanks so much for posting! My setup is a little different but I found the file to amend in etc/apache2/apache2.conf
Thanks again!
Jon
THANKS!!
After one day of struggeling I found this post! THANKS!