The Apache service fails to start: Cannot load /usr/lib/apache2/modules/mod_security2.so

Created:

2017-06-20 11:22:42 UTC

Modified:

2017-08-08 13:18:08 UTC

0

Was this article helpful?


Have more questions?

Submit a request

The Apache service fails to start: Cannot load /usr/lib/apache2/modules/mod_security2.so

Symptoms

The Apache service fails to start:

[root@server ~]# service apache2 status
Jun 20 12:11:16 server.example.com apache2[7417]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/security2.load: Cannot load /usr/lib/apache2/modules/mod_security2.so

The file security2.load contains a link to a nonexistent file mod_security2.so:

[root@server ~]# cat /etc/apache2/mods-enabled/security2.load
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so
[root@server ~]# ls /usr/lib/apache2/modules/mod_security2.so
ls: cannot access /usr/lib/apache2/modules/mod_security2.so: No such file or directory

Cause

The ModSecurity module mod_security2.so is absent on the system.

Resolution

  1. Comment the line in the file security2.load as below:

    [root@server ~]# cat /etc/apache2/mods-enabled/security2.load
    #LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so
  2. Start the Apache service.
  3. Reinstall ModSecurity using Plesk Installer.

 

Have more questions? Submit a request
Please sign in to leave a comment.