• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How To Install ModSecurity On Linux Mint 20.2

  • 00:42 lsb_release -a
  • 01:06 apt-get install libapache2-mod-security2
  • 01:47 apachectl -M | grep --color security
  • 02:16 nano /etc/apache2/apache2.conf
  • 03:15 systemctl restart apache2
  • 03:43 apachectl -M | grep --color security
  • 04:47 mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf
  • 05:10 nano /etc/modsecurity/modsecurity.conf
  • 06:09 systemctl restart apache2
  • 07:06 nano /etc/apache2/mods-enabled/security2.conf
  • 07:27 systemctl restart apache2
6864

To Install ModSecurity On Linux Mint 20.2

Introduction :

ModSecurity is a plug-in module for Apache that works like a firewall. ModSecurity can also monitor web traffic in real time and help you detect and respond to intrusions. It can be used with Apache, Nginx, and IIF and is compatible with Debian, Ubuntu, and CentOS.

Installation procedure :

Step 1 : Check the OS Version by using the below command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20.2
Release:	20.2
Codename:	uma

Step 2 : Install the Modsecurity by using the below command

root@linuxhelp:~# apt-get install libapache2-mod-security2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liblua5.1-0 modsecurity-crs
Suggested packages:
  lua geoip-database-contrib ruby python
The following NEW packages will be installed:
  libapache2-mod-security2 liblua5.1-0 modsecurity-crs
0 upgraded, 3 newly installed, 0 to remove and 16 not upgraded.
Need to get 527 kB of archives.
After this operation, 4,202 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 liblua5.1-0 amd64 5.1.5-8.1build4 [99.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/universe amd64 libapache2-mod-security2 amd64 2.9.3-1 [224 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 modsecurity-crs all 3.2.0-1 [203 kB]

Step 3 : check if the mod_security module is running, use the following command we can view a module named security2_module (shared) which indicates that the module was loaded

root@linuxhelp:~# apachectl -M | grep --color security
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
 security2_module (shared)

Step 4 : Edit the apache2.conf comfiguration file by using the below command

root@linuxhelp:~# nano /etc/apache2/apache2.conf 
ServerName	localhost

Step 5 : Restart the apache2 web server by using the below command

root@linuxhelp:~# systemctl restart apache2

Step 6 : Check the Security module is enabled or not by using the below command

root@linuxhelp:~# apachectl -M | grep --color security
 security2_module (shared)

Step 7 : Enable the mod_security rules and rename and edit the mod security recommended configuration file by using the below command

root@linuxhelp:~# mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf

Step 8 : Set the SecRuleEngine option to On and run use the below command

root@linuxhelp:~# nano /etc/modsecurity/modsecurity.conf 
SecRuleEngine On

Step 9 : Restart the apache2 web server by using the below command

root@linuxhelp:~# systemctl restart apache2

Step 10 : There are lot of security rules that come with Modesecurity (called the Core Rule Set) that are located in the “/usr/share/modsecurity-crs” directory. Now we need to enable these rules to get it working with Apache

root@linuxhelp:~# nano /etc/apache2/mods-enabled/security2.conf 
IncludeOptional  “/usr/share/modsecurity-crs/*.con”
IncludeOptional  “/usr/share/modsecurity-crs/base_rules/*.conf

Step 11 : Restart the apache2 web server by using the below command

root@linuxhelp:~# systemctl restart apache2

With this the process of installing Modsecurity On Linux Mint 20.2 has comes to an end

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is meant by ModSecurity?

A

ModSecurity is an open-source Web Application Firewall (WAF) that can be installed as a module inside the Apache, Nginx, or IIS web servers.

Q

What is the difference between ModSecurity and CRS?

A

ModSecurity is a firewall engine that can inspect traffic on your web server. It can log and block requests. However, an engine does nothing without a certain policy. The CRS delivers a policy where requests to your web applications are inspected for various attacks, and malicious traffic is blocked.

Q

What is a Virtual Patch and why should I care?

A

Fixing identified vulnerabilities in web applications always requires time. Organizations often do not have access to a commercial application's source code and are at the vendor's mercy while waiting for a patch. Even if they have access to the code, implementing a patch in development takes time.

Q

What attacks do the Core Rules protect against?

A

In order to provide generic web applications protection, the Core Rules use the following techniques:
HTTP protection - detecting violations of the HTTP protocol and a locally defined usage policy. Common Web Attacks Protection - detecting common web application security attacks. Automation detection - Detecting bots, crawlers, scanners, and another surface malicious activity.

Q

What's new in ModSecurity and why should I upgrade if I am already using ModSecurity 1. x?

A

In order to use the OWASP ModSecurity Core Rules, you must use the 2. x version of ModSecurity as it takes advantage of specific features not available in previous versions.

Related Tutorials in How To Install ModSecurity On Linux Mint 20.2

Related Tutorials in How To Install ModSecurity On Linux Mint 20.2

How to install WinRAR 5.11 on Linuxmint 18.03
How to install WinRAR 5.11 on Linuxmint 18.03
May 22, 2018
How to Setup VNC Server on Linux Mint 20
How to Setup VNC Server on Linux Mint 20
Dec 22, 2020
How to install and configure samba setup in Linux mint - 18.3
How to install and configure samba setup in Linux mint - 18.3
Mar 26, 2018
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Sep 19, 2018
How to Install and Configure Samba on Linux Mint 20
How to Install and Configure Samba on Linux Mint 20
Nov 9, 2020
How to Install NextCloud on Linux Mint 18.3
How to Install NextCloud on Linux Mint 18.3
Feb 27, 2018
How To Install And Update OpenSSL On Linuxmint 18.3
How To Install And Update OpenSSL On Linuxmint 18.3
Jun 8, 2018
How To Install AnyDesk on Linux Mint 18.3
How To Install AnyDesk on Linux Mint 18.3
Apr 11, 2018

Related Forums in How To Install ModSecurity On Linux Mint 20.2

Related Forums in How To Install ModSecurity On Linux Mint 20.2

Linux
isaac class=
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/mysql-client-core-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb 404 Not Found
Dec 4, 2020
Mongodb
caden class=
Unrecognized option: security In MongoDB 4.0.11 On CentOS 7.6
Aug 31, 2019
Linux Mint
AlxH class=
Complete beginner, install bluegriffon
Jul 1, 2020
Linux
AadrikaAnshu class=
How to add timestamps to history On Any Linux Machine
Jun 18, 2019
Linux Mint
bz0 class=
How to change a function of a key
Jun 7, 2019
Linux
mason class=
semanage command not found
Apr 10, 2017
Linux Mint
who class=
How to compare multiple files
Nov 10, 2019
NFS (Network File System)
Mike class=
Linux Mint 18.3 - NFS Shares - Only Root Can Mount Share
Oct 4, 2019

Related News in How To Install ModSecurity On Linux Mint 20.2

Related News in How To Install ModSecurity On Linux Mint 20.2

A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
Apr 9, 2019
5 Best Secure and Private Web Browsers to Look Our For
5 Best Secure and Private Web Browsers to Look Our For
Nov 24, 2018
Linux Mint 18.2 Ubuntu based Operating System is named Sonya
Linux Mint 18.2 Ubuntu based Operating System is named Sonya
May 2, 2017
Refreshed Linux Mint Debian Edition (LMDE) 2 'Betsy' ISO images now available
Refreshed Linux Mint Debian Edition (LMDE) 2 'Betsy' ISO images now available
Mar 14, 2017
The Best Linux Operating System is in the house: Mint 18.2
The Best Linux Operating System is in the house: Mint 18.2
Aug 12, 2017
Linux Mint 18.1 released with smooth features and offers long-term support
Linux Mint 18.1 released with smooth features and offers long-term support
Apr 11, 2017
RoboCyberWall created to block Linux Server Hacks
RoboCyberWall created to block Linux Server Hacks
Oct 5, 2017
Linux Mint 18.2 Sonya Beta version now available for download
Linux Mint 18.2 Sonya Beta version now available for download
Jun 7, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Elijah ?
Remote Desktop Connection Has Stopped Working

When accessing my remote machine server using remote desktop on a windows machine I am getting this error

forum (1)

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.