0

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

  • Hi, Can you post or check the offending line? line 13 of /etc/httpd/conf.d/00_mod_security.conf. I think it is looking for "00*exclude.conf'". Was there a config file before? Maybe comment out that line and see if that let's you start? I think you need to carefully investigate and check to see what has changed after the yum update. – Tux_DEV_NULL Oct 2 '19 at 10:08
  • Thanks for replying. here is the code inside: 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> I tried to comment out, then its says in line 14 of... However, Mod_security in not installed in my server – hii Oct 2 '19 at 10:18
  • Would you edit the question and add excerpt of /etc/httpd/conf/httpd.conf line 360 and the whole /etc/httpd/conf.d/00_mod_security.conf and an ls -la of /etc/httpd/modsecurity.d ? – Marco Oct 2 '19 at 11:35
  • @Marco I have updated – hii Oct 2 '19 at 11:51
1

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.

| improve this answer | |
  • Thanks @Marco, I am get now a different error [root@waaaa ~]# **apachectl configtest** AH00112: Warning: DocumentRoot [/var/www/domainx.co.uk/public_html] does not exist (2)No such file or directory: AH02291: Cannot access directory '/var/www/domainx.co.uk/' for error log of vhost defined at /etc/httpd/sites-enabled/domainxco.uk.conf:1 AH00014: Configuration check failed – hii Oct 2 '19 at 13:10
  • It really seems you have the whole apache config messed up, like if you blindly updated from a very old version of Apache. I think you should review what you've done to find yourself in this situation in order to better understand, and then fix, and maybe then open a new question if you need more help, avoid turning this one in a troubleshooting/support chat. – Marco Oct 2 '19 at 13:14
  • Thanks Marco, I gave up, just restored to backup. :) Gonna give it a go next day – hii Oct 2 '19 at 14:01
  • Read yum's warnings this time before Y :) – Marco Oct 2 '19 at 15:12
0

Make sure there are no rogue config file calls that no longer exists.

Make sure EPEL Repository is enabled:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

Reinstall Mod_Sec:

yum install mod_security mod_security_crs

Make sure it's active:

Go to etc/httpd/conf.d/mod_security.conf at the SecRuleEngine zone.

Restart apache:

service httpd restart
| improve this answer | |
  • In directory /etc/httpd/conf.d there is a file called 00_mod_security.conf but not mod_security.conf Any thoughts? – hii Oct 2 '19 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.