CentOS

Failed to create temporary file: /var/lib/mod_security/20xx

JJ
Jobin Joseph · Founder and CEO
·Published 27 October 2023·1 min read

Today, the developer reported that the he is not able to upload some files.

As we checked, we were getting the following error on mod_security log.

Message: Input filter: Failed to create temporary file: /var/lib/mod_security/20231027-063404-ZTtZ3Bs-KzTcnh@YiPa2YAAAAAw-request_body-Yidqhf
Message: Audit log: Failed to lock global mutex: Permission deni

It looks like apache is getting denied while writing in to /var/lib/mod_security/ location.

As a quick fix, we have modified the mod_security.conf configuration file located at /etc/httpd/conf.d/mod_security.conf

    SecRequestBodyAccess On
    #SecTmpDir /var/lib/mod_security
    #SecDataDir /var/lib/mod_security
    SecTmpDir /tmp
    SecDataDir /tmp

Once modified, restarted the service with systemctl restart httpd command and the developer was able to upload the files.

Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →