WordPress ISP config and weird HTTP error on media uploads

I ran into this strange problem – on a WordPress installation running on top of Ubuntu 12.04 with ISP config there was this site which had problems accepting files over roughly 150kB. When the file was larger it ended up with “HTTP error” and upload did not finish.

But fear not – here is the solution:

The easy way:

stop using fast-cgi and switch to SuPHP. This might be a quick fix but might lead to other issues (performance, security etc.)

The hacker way:

1. login to your SSH for convenience do

sudo su

(right – be careful!)

2. edit file fcgid.conf

nano /etc/apache2/mods-enabled/fcgid.conf

3. add line MaxRequestLen 15728640 (value is in bytes so it equals to roughly 15MB) the file then looks like this:

<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
FcgidConnectTimeout 20
MaxRequestLen 15728640

4. restart apache webserver

/etc/init.d/apache2 restart

5. Profit! 🙂