Error Upload File on Centos Server | ModSecurity: Access denied “MULTIPART_UNMATCHED_BOUNDARY” required
I have error when trying to upload file on my web application using centos server. Then i do something like this :
- I check my code for handling upload file and there’s nothing wrong, cause when i try in local server it’s work.
- I check php.ini configuration for max upload file at /etc/php.ini then make sure Maximum allowed size for uploaded files and all it’s great. upload max file is 128Mb. But i’m still got error.
- Then i check on log at /var/log/httpd/ssl_error_log and i got error message like this.
[Mon Dec 28 17:50:54 2020] [error] [client 172.69.35.48] ModSecurity: Access denied with code 44 (phase 2). Match of “eq 0” against “MULTIPART_UNMATCHED_BOUNDARY” required. [file “/etc/httpd/conf.d/mod_security.conf”] [line “39”] [id “200003”] [msg “Multipart parser detected a possible unmatched boundary.”] [hostname “ereport.ptp.co.id”] [uri “/sop_revisi”] [unique_id “X@m4in8AAAEAAElKIBoAAAAF”]
- This error message said that Multipart parser detected a possible unmatched boundary. I don’t know what is it but when i search for solution. I must to comment some line on file /etc/httpd/conf.d/mod_security.conf.
Solution
- I open file /etc/httpd/conf.d/mod_security.conf
- Search for this code, MULTIPART_UNMATCHED_BOUNDARY
- Give comment with add “#”
- Then restart httpd using command service httpd restart
- Then i try to upload it again and success, That’s it. hope it help.
Reference
Thank for reading my articles
If you have any question or opportunity you can connect with me on
- Instagram : @sambatngoding , @chalidade
- LinkedIn : https://www.linkedin.com/in/chalidaderahman/
- Email : Chalidade@gmail.com
And here if you wanna give me some cup of coffee