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

0 Members and 1 Guest are viewing this topic.

Offline
*
apache wont restart after enabling mod_security.
« on: June 25, 2024, 08:51:16 PM »
For some reason when you install mod_security the config file for it has an extra line:

LoadFile /usr/lib64/

Which errors out Apache when loading:

httpd: Syntax error on line 512 of /usr/local/apache/conf/httpd.conf: Syntax error on line 2 of /usr/local/apache/conf.d/mod_security.conf: Cannot load /usr/lib64/ into server: /usr/lib64/: cannot read file data: Is a directory


Removing that line makes it load fine.  Not sure if another file was supposed to be loaded by that line.   

Currently testing CWP on Alma Linux 9.4


Thanks!

Offline
*****
Re: apache wont restart after enabling mod_security.
« Reply #1 on: June 25, 2024, 11:02:56 PM »
EL9 support is still in beta with CWP. Test for that error when it is fully production ready for AlmaLinux 9

Offline
*****
Re: apache wont restart after enabling mod_security.
« Reply #2 on: June 27, 2024, 10:57:25 PM »
There seems to be a install problem.

Code: [Select]
nano /usr/local/apache/conf.d/mod_security.conf
Line 2 – Add – liblua-5.4.so to the end.

Code: [Select]
systemctl start httpd
« Last Edit: June 27, 2024, 11:00:39 PM by Starburst »

Offline
*
Re: apache wont restart after enabling mod_security.
« Reply #3 on: August 04, 2024, 09:12:21 PM »
I am having this same issue after installing cwp on Alma-9.

Can anyone share how they might have solved it?

Offline
*****
Re: apache wont restart after enabling mod_security.
« Reply #4 on: August 06, 2024, 11:22:53 AM »
What is the error message Apache is giving?

From what I've seen, the above fixes it.

Offline
*
Re: apache wont restart after enabling mod_security.
« Reply #5 on: August 06, 2024, 12:40:21 PM »
Its resolved now

Offline
*
Re: apache wont restart after enabling mod_security.
« Reply #6 on: August 29, 2024, 08:24:00 AM »
how to solve this problem. plss help.;

Offline
*
Re: apache wont restart after enabling mod_security.
« Reply #7 on: August 29, 2024, 08:32:30 AM »
Its resolved now
edit mod_security.conf
nano /usr/local/apache/conf.d/mod_security.conf


LoadFile /usr/lib64/libxml2.so
LoadFile /usr/lib64/         <<<----------------remove this line.

<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>
« Last Edit: August 29, 2024, 08:35:58 AM by hatnaa »

Offline
*****
Re: apache wont restart after enabling mod_security.
« Reply #8 on: August 29, 2024, 11:25:17 AM »
Actually the fix is to add - liblua-5.4.so
to the end of that line for AlmaLinux.

After it should read:

Code: [Select]
LoadFile /usr/lib64/liblua-5.4.so
This fix was mentioned above, and has been tested and works on all of our new servers.