Would you like to learn how to install the Apache Modsecurity feature? In this tutorial, we are going to configure the Apache’s Modsecurity feature on a computer running Ubuntu Linux.
• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Apache 2.4.41
• ModSecurity 3.0.4
Copyright © 2018-2021 by Techexpert.tips.
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means without the prior written permission of the publisher.
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Apache – Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Apache.
Tutorial Apache – ModSecurity installation
Install the Apache server.
Install the required packages.
Install the software named SSDEP.
Download the latest version of ModSecurity.
Compile and install ModSecurity.
Download the latest version of the Apache connector for ModSecurity.
Compile and install the Apache connector.
Download and install the ModSecurity Core Rule Set.
Congratulations! You have finished the ModSecurity installation on the Apache server.
Tutorial Apache – ModSecurity configuration
Create a file to enable the use of ModSecurity.
Here is the file content.
Create a directory named Modsec and copy the required configuration files.
Edit the ModSecurity configuration file.
Locate the following lines.
Change these lines to the following configuration.
Here is the file after our configuration.
Create a file to enable ModSecurity to use the installed CRS rules.
Here is the file content.
Restart the Apache service.
Verify if the Apache module named Security3_module was loaded.
Here is the command output.
Optionally, use your browser to send a test request to the Apache server.
After sending a test request, verify the ModSecurity log
Congratulations! You have finished the ModSecurity configuration on the Apache server.