Author Topic: After installing Mod Security, Apache cannot start  (Read 68 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
After installing Mod Security, Apache cannot start
« on: April 04, 2026, 12:37:39 AM »
After installing Mod Security, Apache cannot start. In the log, I saw the following error. How should I fix it?

Apr  4 00:26:59 li117 systemd[1]: Starting Web server Apache...
Apr  4 00:26:59 li117 kernel: Firewall: *UDP_OUT Blocked* IN= OUT=eth0 SRC=117.000.000.000 DST=110.000.000.000 LEN=
Apr  4 00:26:59 li117 apachectl[3256381]: httpd: Syntax error on line 513 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
Apr  4 00:26:59 li117 systemd[1]: httpd.service: Control process exited, code=exited, status=1/FAILURE
Apr  4 00:26:59 li117 systemd[1]: httpd.service: Failed with result 'exit-code'.
Apr  4 00:26:59 li117 systemd[1]: Failed to start Web server Apache.

Offline
*****
Re: After installing Mod Security, Apache cannot start
« Reply #1 on: April 04, 2026, 12:47:05 AM »
What OS/distribution are you running? CWP-provided Mod Security version? What ruleset?
Under AlmaLinux 8, lines one and two in my /usr/local/apache/conf.d/mod_security.conf file are:
Code: [Select]
LoadFile /usr/lib64/libxml2.so
LoadFile /usr/lib64/liblua-5.1.so

Offline
*
Re: After installing Mod Security, Apache cannot start
« Reply #2 on: April 04, 2026, 12:55:00 AM »
OS: AlmaLinux release 9.6
Mod Security version: Mod Security has been uninstalled, I don't know
Ruleset. I tried OWASP old and Comodo WAF, and Apache cannot start with either.

Offline
*****
Re: After installing Mod Security, Apache cannot start
« Reply #3 on: April 04, 2026, 02:34:57 PM »
If you wanted to PM me your connection details, I could try to install it for you.

Offline
*****
Re: After installing Mod Security, Apache cannot start
« Reply #4 on: April 04, 2026, 03:53:17 PM »
For some reason when you install ModSecurity, line 2 of /usr/local/apache/conf.d/mod_security.conf needs to be manually fixed.

By Default is only has:
Code: [Select]
LoadFile /usr/lib64/
You need to edit it, say the whole line says:
Code: [Select]
LoadFile /usr/lib64/liblua-5.4.so
Save, and then start Apache.