Centos 7 – Apache failed to load after Yum update

centosfailedupdateyum

I got Centos 7 on my server. Yum update was not working because clamav was causing problem, so I deleted it. So it let me to do Yum Update. After that update was successful, but then apache server failed to load. How could I fix it? Thank you!

[root@waaaa ~]# systemctl -l status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2019-10-02 09:28:49 UTC; 12min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 2482 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 2480 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 2480 (code=exited, status=1/FAILURE)

Oct 02 09:28:49 waaaa.com systemd[1]: Starting The Apache HTTP Server...
Oct 02 09:28:49 waaaa.com httpd[2480]: [Wed Oct 02 09:28:49.794195 2019] [so:warn] [pid 2480] AH01574: module unique_id_module is already loaded, skipping
Oct 02 09:28:49 waaaa.com httpd[2480]: httpd: Syntax error on line 360 of /etc/httpd/conf/httpd.conf: Syntax error on line 13 of /etc/httpd/conf.d/00_mod_security.conf: No matches for the wildcard '00*exclude.conf' in '/etc/httpd/modsecurity.d', failing (use IncludeOptional if required)
Oct 02 09:28:49 waaaa.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 02 09:28:49 waaaa.com kill[2482]: kill: cannot find process ""
Oct 02 09:28:49 waaaa.com systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 02 09:28:49 waaaa.com systemd[1]: Failed to start The Apache HTTP Server.
Oct 02 09:28:49 waaaa.com systemd[1]: Unit httpd.service entered failed state.
Oct 02 09:28:49 waaaa.com systemd[1]: httpd.service failed.

Also I have check for "Apachectl configtest" and it gives out:

[root@waaaa ~]# apachectl configtest
[Wed Oct 02 09:46:16.221482 2019] [so:warn] [pid 6980] AH01574: module unique_id_module is already loaded, skipping
httpd: Syntax error on line 360 of /etc/httpd/conf/httpd.conf: Syntax error on line 13 of /etc/httpd/conf.d/00_mod_security.conf: No matches for the wildcard '00*exclude.conf' in '/etc/httpd/modsecurity.d', failing (use IncludeOptional if required)
[root@waaaa ~]#

Updated 12:51
File etc/httpd/conf/httpd.conf in line 360 says IncludeOptional conf.d/*.conf

This is what included in etc/httpd/conf.d/00_mod_security.conf

# ASL Free trial ruleset is available at: https://atomicorp.com/amember/signup/cart/

LoadModule security2_module modules/mod_security2.so
LoadModule unique_id_module modules/mod_unique_id.so

<IfModule mod_security2.c>
# Basic configuration goes in here
Include modsecurity.d/tortix_waf.conf

# Rule management is handled by ASL
Include modsecurity.d/00*exclude.conf
Include modsecurity.d/*asl*.conf
Include modsecurity.d/99*exclude.conf

</IfModule>

Files in directory /etc/httpd/modsecurity.d :

activated_rules
modsecurity_crs_10_config.conf
tortix_waf.conf

Best Answer

Since the included files do not exist, I think that if you edit 00_mod_security.conf this way:

# Rule management is handled by ASL
IncludeOptional modsecurity.d/00*exclude.conf
IncludeOptional modsecurity.d/*asl*.conf
IncludeOptional modsecurity.d/99*exclude.conf

You'll get apache back running until you are able to reinstall and enable mod_security. Probably your upgrade disrupted the old mod_security, but we can't say since we don't know the way it has been originally installed.