How to do it...

In this section, we will see how to install and configure the ModSecurity Web Application Firewall (WAF) to block country-specific traffic:

  1. Once Apache has been installed on Ubuntu, the next step is to install ModSecurity by running the following command:

  1. After installing ModSecurity, restart Apache:

  1. To confirm that ModSecurity has been installed successfully, run the following command:

If the installation is successful, ...

Get Practical Linux Security Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.