We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
[SOLVED] Moodle, Wordpress can't upload files / modsecurity limits the upload file size
[SOLVED] Moodle, Wordpress can't upload files / modsecurity limits the upload file size
Hey everyone, i hope someone can help me out, i'm going crazy with this...
i set a moodle site, works Ok, BUT: I can't upload large files, it seems that files over 120 KB are not loadded, the error in the moodle page says it could be the max_post_size in php.ini, but i already set this to higher values and phpinfo shows the correct values i entered.
My conf files are: snginx, nginx, sapache2, apache2
(http redirects to https, letsencrypt certificate)
phpinfo shows:
in moodle, loged in as a user with admin privileges, everytime i want to upload a file (for example image user profile) the error is (in spanish):
google translated: The uploaded file may exceed the max_post_size directive of php.ini
Already restarted apache2 and nginx, several times...
Hope someone can help!
thanks!
i set a moodle site, works Ok, BUT: I can't upload large files, it seems that files over 120 KB are not loadded, the error in the moodle page says it could be the max_post_size in php.ini, but i already set this to higher values and phpinfo shows the correct values i entered.
My conf files are: snginx, nginx, sapache2, apache2
(http redirects to https, letsencrypt certificate)
phpinfo shows:
Code: Select all
PHP Version 7.0.18-0ubuntu0.16.04.1
Configuration File (php.ini) Path /etc/php/7.0/apache2
Loaded Configuration File /etc/php/7.0/apache2/php.ini
post_max_size 15M
upload_max_filesize 10M
Code: Select all
El archivo subido puede que exceda la directiva max_post_size del php.ini.
URL:
null
Debug info:
null
Stack trace:
null
Already restarted apache2 and nginx, several times...
Hope someone can help!
thanks!
Last edited by maxplay on Tue May 30, 2017 1:54 am, edited 1 time in total.
Re: moodle upload file size
In VestaCP panel, go to Server -> nginx -> Configure, and modify this accordingly to your needs:
Suerte.
Code: Select all
client_max_body_size
[SOLVED] Moodle, Wordpress can't upload files / modsecurity limits the upload file size
Trentor, thanks for your post. I've done that and no effect at all.
I found the problem because i tested my uploads in a wordpress site, same server, and there's the problem again, "HTTP Error"
A few days ago i installed modsecurity, and in my modsecurity.conf:
SecRuleEngine wasn't 'On', so i thought it wasn't applying changes to my traffic, but yes, it was...
i'm afraid as i didn't modify any else parameter, as:
then it was indeed limiting the upload size
So to quickly solve it (not thinking...sorry, i should read and test which option i must change); i did:
maybe with "SecRequestBodyAccess off" it just did the trick, but i didn't test any further yet
So, briefly: the problem was not moodle or wordpress, neither php.ini nor nginx or apache, it was this modsecurity apache module that limits the body size or file upload size
--> so i changed the Subject of my original post in case it helps someone else
(the file upload limit was 128KB = 131072, before)
Thanks all,
maxplay
I found the problem because i tested my uploads in a wordpress site, same server, and there's the problem again, "HTTP Error"
A few days ago i installed modsecurity, and in my modsecurity.conf:
Code: Select all
SecRuleEngine DetectionOnly
i'm afraid as i didn't modify any else parameter, as:
Code: Select all
SecRequestBodyAccess On
So to quickly solve it (not thinking...sorry, i should read and test which option i must change); i did:
Code: Select all
# add one 0 to the end
SecRequestBodyLimit 131072000
# add 2 0's to the end
SecRequestBodyNoFilesLimit 13107200
# add 2 0's to the end
SecRequestBodyInMemoryLimit 13107200
So, briefly: the problem was not moodle or wordpress, neither php.ini nor nginx or apache, it was this modsecurity apache module that limits the body size or file upload size
--> so i changed the Subject of my original post in case it helps someone else
(the file upload limit was 128KB = 131072, before)
Thanks all,
maxplay