Author Topic: apache wont restart after enabling mod_security.  (Read 2598 times)

0 Members and 1 Guest are viewing this topic.

Offline
*****
Re: apache wont restart after enabling mod_security.
« Reply #15 on: February 27, 2025, 09:34:11 AM »
That's not a valid config for ModSecurity.
One is generated automatically and installed when you install ModSecurity, so not sure how that happened.

If you are using the old Comodo the main configuration should look like (/usr/local/apache/conf.d/mod_security.conf)

Code: [Select]
LoadFile /usr/lib64/libxml2.so
LoadFile /usr/lib64/liblua-5.4.so

<IfModule !unique_id_module>
LoadModule unique_id_module modules/mod_unique_id.so
</IfModule>

<IfModule !mod_security2.c>
LoadModule security2_module  modules/mod_security2.so
</IfModule>

<IfModule mod_security2.c>
    <IfModule mod_ruid2.c>
        SecAuditLogStorageDir /usr/local/apache/logs/modsec_audit
        SecAuditLogType Concurrent
    </IfModule>
    <IfModule itk.c>
        SecAuditLogStorageDir /usr/local/apache/logs/modsec_audit
        SecAuditLogType Concurrent
    </IfModule>

           
              SecRuleEngine On
              SecAuditEngine RelevantOnly
    SecAuditLog /usr/local/apache/logs/modsec_audit.log
    SecDebugLog /usr/local/apache/logs/modsec_debug.log
    SecAuditLogType Serial
    SecDebugLogLevel 0
    SecRequestBodyAccess On
    SecDataDir /tmp
    SecTmpDir /tmp
    SecUploadDir /tmp
    SecCollectionTimeout 600
    SecPcreMatchLimit 1250000
    SecPcreMatchLimitRecursion 1250000
              Include "/usr/local/apache/modsecurity-cwaf/cwaf.conf"
</IfModule>

From your input, it looks like you are trying to load the site config files from the WebServers Configuration Editor.