OK here's a fun one, after much reading about the reason I couldn't get files to upload via http(s) for a client (my good lady's audio typing website) there are tips aplenty on StackOverflow and others telling you to reset the FcgidMaxRequestLen parameter in the mod_fcgi module block in both vhost.conf and the fcgid.conf, which I duly did.
(side point) I may as well mention at this point, the server we purchase from 1&1 Internet is a Plesk Control Panel which is fine until you want to do major customisation. In the past if you made changes to the core php.ini or vhost.conf file you would find it was overwritten each time a Plesk update was implemented or for whatever reason re-compiled. Latter versions of Plesk have made it easier to manage this by placing safe copies of localised conf files in a new system sub-folder, but still a pain when you don't know where to look!
Older versions of Plesk = /var/www/vhosts/{your-domain}/etc
Plesk 11+ = var/www/vhosts/system{your-domain}
But this is an aside and largely only confined to php.ini changes.
Our local php.ini file which seemed to pickup the changes which were identified within it when running the phpinfo() command showed the custom settings
set into the php environment
So, with these settings in place we proceeded to attempt to upload sound files. No luck, and didn't even get errors so were completely in the dark.
We got an nginx error was identified as a PHP framework issue and that was fixed during which we set the log files to be in the root of the vhost file which, on Plesk 11 + looks like this
So, each upload then started throwing a common line based on a configuration entry which looked like this:
[warn] [client ip address] mod_fcgid: HTTP request length 134220467 (so far) exceeds MaxRequestLen (134217728), referer: name of script running the upload
OK so did more googling and found lots of results for newer builds of apache running with a low limit of 128K per upload, so duly followed these and updated the:
/etc/httpd/conf.d/fcgid.conf and added the recommended lines:
MaxRequestLen 2147483648
FcgidMaxRequestInMem 2147483648
Which covers the earlier version of fastcgi with the MaxRequestLen entry and newer modules with the FcgidMaxRequestInMem entry, both of which were set to around 2Gb.
Did the same with the vhost.conf file located in /var/www/vhosts/system/domain-name/
adding the following block:
<IfModule mod_fcgid.c>
MaxRequestLen 2147483648
FcgidMaxRequestLen 2147483648
</IfModule>
again covering both sets of bases by declaring the values to be in excess of the limit in the error.
Nothing, still getting the upload error with the same old:
[warn] [client ip address] mod_fcgid: HTTP request length 134220467 (so far) exceeds MaxRequestLen (134217728), referer: name of script running the upload
OK so what the hell is going on here? I'm restarting apache and even the nginx and psa services to make sure it's bringing the new configurations online.
Back to the php.ini file, showed the localised settings were all working fine.
Time to get to grips with grep - seeing that the value we were all the same I ran a grep command to see where within the main system settings there was an occurance of this value:
grep -r "134217728" /etc/ which will recursively search for all occurances of the phrase "134217728" in all files.
Lo and behold!
I see a new entry which is located in /etc/httpd/conf/plesk.conf.d/ip_default/ called
domain-name.conf (e.g. abc.com.conf)
Opening this I see that there are two lines within the conf file which read:
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/system/transcription.1stclass.uk.com/etc/php.ini
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX fastcgi
FcgidMaxRequestLen 134217728
</IfModule>
and a second and apparently duplicate entry:
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/system/transcription.1stclass.uk.com/etc/php.ini
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX fastcgi
FcgidMaxRequestLen 134217728
</IfModule>
Modifying the red text entries to be 2147483648 and restarting apache
service httpd restart enabled us to upload large files.
So, lesson learned, if you are using Parallels Plesk Control Panel and need to change a commonly used entry, do yourself a favour and use grep to locate localised (or Plesk controlled) versions of module configurations - it's better than ploughing through 100s of Google searches (none of which suggested this at all!!)
Happy Grepping!
1st Class Media is a Midlothian-based web development company, 8 miles South of Edinburgh in Scotland, UK. We like to share ideas, technical or otherwise which can be of use to others or pique the interest of people similarly minded
Monday, 26 January 2015
Sunday, 11 January 2015
Freight Forwarding and Logistics - another shameless client promotion!
OK, Here we go with another shameless self-promotion for a client for whom we are doing management of ad marketing and promotion.
T ward is a company of some standing in the shipping world, having been around the business for over 100 years they provide a wealth of knowledge for freight forwarding and logistics for numerous clients around the world. Being a complete luddite and also nosy in the same measure I felt a little out of my depth when it came to knowing what made freight forwarding a service at all! With Callum and Nigel's help I was suddenly propelled into the complex and hitherto completely unknown world of international shipping and logistics.
When you imagine these monstrous cargo ships coming in from China or Japan you think, "ok one of those gazillion containers probably contains my next TV" but the scope of the shipping exercise is massive and I ended up applauding the Freight Forwarding guys as they deal with numerous elements which comprise the whole process of logistics as well, including:
In summary, if you are looking to ship cargo worldwide, then get in touch with a reputable, experienced and knowledgeable agent such as t ward shipping, they really do know what it's all about, and heaven knows, it's a lot!!
T ward is a company of some standing in the shipping world, having been around the business for over 100 years they provide a wealth of knowledge for freight forwarding and logistics for numerous clients around the world. Being a complete luddite and also nosy in the same measure I felt a little out of my depth when it came to knowing what made freight forwarding a service at all! With Callum and Nigel's help I was suddenly propelled into the complex and hitherto completely unknown world of international shipping and logistics.
When you imagine these monstrous cargo ships coming in from China or Japan you think, "ok one of those gazillion containers probably contains my next TV" but the scope of the shipping exercise is massive and I ended up applauding the Freight Forwarding guys as they deal with numerous elements which comprise the whole process of logistics as well, including:
- Customs clearance
- Haulage and Transportation
- Storage
- Payment of duty
- Freight and related expenses
In summary, if you are looking to ship cargo worldwide, then get in touch with a reputable, experienced and knowledgeable agent such as t ward shipping, they really do know what it's all about, and heaven knows, it's a lot!!
Subscribe to:
Posts (Atom)