Part 1 – Compiling and Installing the Modules and Enabling ModSecurity v3
This guide shows the complete installation of ModSecurity v3 with NGINX and the OWASP Core Rule Set (CRS) on an Ubuntu server – including correct module paths, symlink conventions, and example tests.
- In Part 1 you install the necessary modules and enable ModSecurity v3.
- In Part 2 we add the OWASP Core Rule Set (CRS).
- In Part 3 we cover the required exceptions for the OWASP Core Rule Set to run a WordPress website.
1. Install Dependencies
sudo apt update
sudo apt install -y git g++ build-essential autoconf automake libtool \
libpcre3 libpcre3-dev libpcre2-dev libxml2 libxml2-dev libyajl-dev \
pkg-config zlib1g zlib1g-dev libcurl4-openssl-dev \
liblua5.3-dev libgeoip-dev doxygen