## General developer forum

### Error connecting to server

Error connecting to server

Hello everyone, everything good? I have a problem with the ulpload of files in moodle. I increased the size of upload_max_size and post_max_size to 2MB (default) to 16MB. However any file above 2MB appears the following error "ERROR CONNECTING THE SERVER".

I have already looked at moodledata permissions and everything is ok. I wonder if anyone has already had this problem and how to solve it.

The image with the error is attached.

Average of ratings: -
Re: Error connecting to server

Depending upon where and how you are hosted, there is an Apache setting.

http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestbody

Normally, the limitrequestbody in Apache is set to 0 ... ie, unlimited ... by default, but depending upon where/how hosted, it could be set to 2M ... and so  whatever you try to do with PHP settings, Apache overrides.

Can you access the main config file for Apache?   Centos: /etc/httpd/conf/httpd.conf Ubuntu I think it's /etc/apache2/conf/apache2.conf

And any change to php or apache config would require restart of apache service.

'spirit  of sharing', Ken

Average of ratings: -
Re: Error connecting to server

Hello my friend!
After many days I managed to find the problem and solve the error.
I checked the server logs and identified error code 44 in plesk that is hosted on AWS.
I commented on two lines in the file:
/etc/httpd/conf.d/mod_security.conf:
Comment security rule which causes the issue in:

# grep 'MULTIPART_UNMATCHED_BOUNDARY' /etc/httpd/conf.d/mod_security.conf
#SecRule MULTIPART_UNMATCHED_BOUNDARY "! @Eq 0" "id: '200003', phase: 2, t: none, log, deny, status: 44, msg: 'Multipart parser detected a possible unmatched boundary'

# service httpd restart

https://support.plesk.com/hc/en-us/articles/213961065-Cannot-attach-files-in-Horde-ModSecurity-Access-denied-with-code-44

Average of ratings: -