How to reinstall ModSecurity package

Refers to:

  • Plesk 11.5 for Linux
  • Plesk
  • Plesk 12.0 for Linux
  • MT:1f40fcc75260811106253002d7855b27
  • MT:220c6be606631cd0b1af74e0fbe16f7f
  • MT:ba76898552831204d986ee86b0e20d20
  • MG:29224d55c81bbf3d5c8a7c7e6de8462c

Created:

2016-11-16 13:10:18 UTC

Modified:

2017-02-20 15:34:42 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to reinstall ModSecurity package

Question

How to reinstall ModSecurity package from the Plesk repository?

Answer

1. Backup the following directories:

For RedHat-based operating systems:

mkdir -p backup_modsec/etc/asl && cp -a /etc/httpd/modsecurity.d/* backup_modsec && cp -a /etc/httpd/conf/modsecurity.d/* backup_modsec && cp -a /etc/asl/* backup_modsec/etc/asl
mkdir -p backup_modsec/var/asl && cp -a /var/asl/* backup_modsec/var/asl

For Debian-based operating systems:

mkdir -p backup_modsec/etc/asl && cp -a /etc/apache2/modsecurity.d/* backup_modsec && cp -a /etc/asl/* backup_modsec/etc/asl
mkdir -p backup_modsec/var/asl && cp -a /var/asl/* backup_modsec/var/asl

2. Remove ModSecurity using Plesk installer

3. Remove the contents from the following directories:

rm -rf /etc/asl/*
rm -rf /var/asl/*
rm -rf /etc/httpd/modsecurity.d/*
rm -rf /etc/httpd/conf/modsecurity.d/*

4. Check if ModSecurity packages remained in the system:

For RedHat-based operating systems:

# rpm --query --all | grep security

For Debian-based operating systems:

# dpkg --list *modsecurity*

5. Remove the existing packages.

For RedHat-based operating systems:

# rpm --erase mod_security-2.8.0-14080716.x86_64 plesk-modsecurity-configurator-12.0.18-cos7.build1200140811.16.noarch plesk-modsecurity-crs-12.0.18-14070712.x86_64

For Debian-based operating systems:

# dpkg --remove libapache2-modsecurity plesk-modsecurity-configurator plesk-modsecurity-crs

6. Check if aum package is still present and remove it if it is still installed:

For RedHat-based operating systems:

# rpm --query --all | grep
# rpm --erase
aum

For Debian-based operating systems:

# dpkg --list *aum*
# dpkg --remove aum && dpkg --purge aum

7. Install ModSecurity using Plesk autoinstaller

Additional information

In case there is an issue with reinstallation, visit:

#214028789 Failed to update the ModSecurity rule set: Authorization failed attempting to download an update

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