I made a lot of modifications to the QD site this weekend which means I also ran into a lot issues. There are so many working pieces (plugins, theme, etc.) that it seems almost impossible these days to just install something new without there being a fairly major issue. Well this weekend I was lucky and ran into multiple.
While troubleshooting a problem with the Translator plugin that is used some pages and/or images were displaying HTML 500 errors for what seemed to be no reason at all. In fact at first I couldn’t even get them to generate any data in the Apache error logs and was relying on seeing that it was a 500 error in the Apache access log. I happened to also look into an issue where the Google XML Sitemap plugin was being rejected by the Googlebot search engine crawler. That ended up saving the day because when I attempted to load the XML sitemap through a browser I finally got an error which is noted below.
- [Tue Nov 24 06:26:02 2009] [error] [client 192.168.1.100] ModSecurity: Output filter: Content-Length (554798) over the limit (524288). [hostname "www.example.com"] [uri "/sitemap.xml"] [unique_id "C4iRgkMSvfoBBAAUDzawABAAJ"]
This was a suprise to me because I totally forgot that I even had the mod_security package installed on the server. After looking around I easily figured out that the issue was caused by the SecResponseBodyLimit configuration option. The Mod Security configuration options can be modified by locating the modsecurity_crs_10_config.conf file which by default on CentOS is located in the /etc/httpd/modsecurity.d/ directory. Once you have located the file open it for editing using your favorite editor such as vi. Search for SecResponseBodyLimit and raise it from its current level which appears to be around 512K to something higher that you are comfortable with. I raised mine to 5MB using the syntax in the configuration below.
Modify ModSecurity SecResponseBodyLimit Option:
- SecResponseBodyLimit 5242880
That setting is all you should need to change for this specific error. Once you have saved the file go ahead and restart apache to verify it resolves your issue. If you did get the Content-Length error though I am fairly confident that your issues will be resolved.
One other thing to note that I learned from this experience is the fact that I had never really thought about attempting to load different file types via a browser to see if they would generate different errors in the Apache error logs. When attempting to load typical HTML or PHP there were no errors generated however right when I attempted to load XML I was lucky enough to get something more descriptive.