{"id":2303,"date":"2020-11-20T09:26:08","date_gmt":"2020-11-20T09:26:08","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=2303"},"modified":"2025-10-07T04:42:03","modified_gmt":"2025-10-07T04:42:03","slug":"how-to-install-mod_security-on-centos-7","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/","title":{"rendered":"How To Install mod_security on CentOS"},"content":{"rendered":"\n<p>Website administrators have to protect their sites from malicious attackers and bots all the time. Otherwise, they can gain unauthorized access to your site content and harm it. mod_security is a popular web application firewall that improves website security and offers website protection against malicious attacks. If your website runs on any of the popular servers such as Apache, NGINX or IIS, it is advisable that you set up mod_security. In this article, we will look at how to install mod_security on CentOS.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#What_is_mod_security\" >What is mod_security<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#Benefits_of_mod_security\" >Benefits of mod_security<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#How_To_Install_mod_security_on_CentOS\" >How To Install mod_security on CentOS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#1_Update_System\" >1. Update System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#2_Install_mod_security_Dependencies\" >2. Install mod_security Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#3_Download_Install_mod_security\" >3. Download &amp; Install mod_security<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#4_Enable_mod_security\" >4. Enable mod_security<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#5_Configure_mod_security\" >5. Configure mod_security<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#6_Restart_Apache_Web_Server\" >6. Restart Apache Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_mod_security\"><\/span>What is mod_security<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.modsecurity.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">mod_security<\/a>, also called modsec, is a web application firewall that offers real-time monitoring, logging and filtering based on user-defined rules. It was initially built as Apache module but has grown to support NGINX and IIS as well. It is open-source and free and widely used by sites running Apache server. It mainly uses regular expressions and a set of rules called SecRules to easily catch and deal with common exploits and vulnerabilities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Benefits_of_mod_security\"><\/span>Benefits of mod_security<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>mod_security provides many useful features such as<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Easy to configure firewall rules<\/li>\n\n\n\n<li>Filter requests and responses across wide range of platforms including Apache, IIS and NGINX<\/li>\n\n\n\n<li>Real time filtering, logging and monitoring<\/li>\n\n\n\n<li>Can be configured within web server or as proxy server<\/li>\n\n\n\n<li>Ability to drop, pass, return, redirect requests or even run script based on user-defined rules<\/li>\n\n\n\n<li>Maintained for more than 20 years, so robust, stable and has wide user base<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_To_Install_mod_security_on_CentOS\"><\/span>How To Install mod_security on CentOS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to install mod_security on CentOS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Update_System\"><\/span>1. Update System<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open terminal and run the following commands to update your system to use latest packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># <code>yum clean all<\/code>\n# <code>yum -y update<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Install_mod_security_Dependencies\"><\/span>2. Install mod_security Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before we install mod_security, we need to install a few packages that it depends upon. Run the following commands to install mod_security dependencies<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install gcc make httpd-devel libxml2 pcre-devel libxml2-devel curl-devel git<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Download_Install_mod_security\"><\/span>3. Download &amp; Install mod_security<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We will download and install mod_security from source code. Run the following commands to download the source file. Replace 2.9.3 with the version number of your choice. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># <code>wget https:\/\/www.modsecurity.org\/tarball\/2.9.3\/modsecurity-2.9.3.tar.gz<\/code>\n<code># tar xzf modsecurity-apache_2.9.3.tar.gz<\/code>\n<code># cd modsecurity-apache_2.9.3<\/code>\n<code># .\/configure<\/code>\n<code># make install<\/code>\n<code># cp modsecurity.conf-recommended \/etc\/httpd\/conf.d\/modsecurity.conf<\/code>\n# <code>cp unicode.mapping \/etc\/httpd\/conf.d\/<\/code><\/pre>\n\n\n\n<p>In the above commands, we use wget command to download the file. Then we use tar command to extract it to directory. Lastly we build and install the package.<\/p>\n\n\n\n<p>mod_security ships with a config file template called modsecurity.conf-recommended. After the package is installed, we copy its config file to \/etc\/httpd\/conf.d\/modsecurity.conf. This will be the file we will modify to control mod_security&#8217;s settings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Enable_mod_security\"><\/span>4. Enable mod_security<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Create a backup of Apache config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo cp \/etc\/httpd\/conf\/httpd.conf \/etc\/httpd\/conf\/httpd-backup.conf<\/pre>\n\n\n\n<p>Open Apache configuration file in a text editor.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo vi \/etc\/httpd\/conf\/httpd.conf<\/pre>\n\n\n\n<p>Enable mod_security by uncommenting the following line by removing # at its beginning<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#LoadModule security2_module modules\/mod_security2.so<\/pre>\n\n\n\n<p>to<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">LoadModule security2_module modules\/mod_security2.so<\/pre>\n\n\n\n<p>The above change will enable mod_security as a module in Apache server. Also add the following lines at the end of the file. This will point Apache to mod_security&#8217;s config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;IfModule security2_module&gt;<\/code>\n   <code>Include conf.d\/modsecurity.conf<\/code>\n<code>&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Configure_mod_security\"><\/span>5. Configure mod_security<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It can be tedious to setup firewall rules from scratch. mod_security provides a set of pre-defined firewall rules to help you get started. You can easily setup core mod_security rules by downloading and installing Open Web Application Security Project (OWASP) rule set.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># <code>cd \/etc\/httpd<\/code>\n# <code>git clone<\/code> <code>https:\/\/github.com\/SpiderLabs\/owasp-modsecurity-crs.git<\/code>\n# <code>mv owasp-modsecurity-crs modsecurity-crs<\/code>\n# <code>cd modsecurity-crs<\/code>\n# <code>cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_config.conf<\/code><\/pre>\n\n\n\n<p>Open Apache web configuration file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># sudo vi \/etc\/httpd\/conf\/httpd.conf<\/pre>\n\n\n\n<p>Add the following lines at its end.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Include modsecurity-crs\/modsecurity_crs_10_config.conf<\/code>\n<code>Include modsecurity-crs\/base_rules\/*.conf<\/code><\/pre>\n\n\n\n<p>If you want to learn more about how to customize mod_security rules refer to this <a href=\"https:\/\/docs.atomicorp.com\/AED\/modSec\/modSecurity.html#\" target=\"_blank\" rel=\"noreferrer noopener\">documentation<\/a>. mod_security is very flexible and allows you to setup rules for one or more domains, IP address, network, application or even URLs. In fact, the latest version mod_security even allows you to configure rules via .htaccess file, without the need of modifying config files or Apache or mod_security.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Restart_Apache_Web_Server\"><\/span>6. Restart Apache Web Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Restart Apache web server to apply changes<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl restart httpd<\/pre>\n\n\n\n<p>To protect your web server, you can also use other solutions like <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/\">change Apache server port number<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to install mod_security in CentOS. You can also use it for similar Linux distributions such as RHEL, Fedora, SUSE. It is important to setup some kind of firewall for your website in today&#8217;s world, to protect it from malicious attackers and bots. There are many free and paid services available for this purpose. Among them, mod_security is one of the most popular firewall applications that is easy to setup and use. It plays well with Apache, IIS and NGINX, which are used by most website and apps these days. <\/p>\n\n\n\n<p> <a href=\"https:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data, and monitor them in real-time dashboards.&nbsp;<a href=\"https:\/\/ubiq.co\/accounts\/register\">Try Ubiq<\/a>&nbsp;for free.<\/p>\n\n\n\n<p>Also read : <br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-index-php-from-url\/\">How to Remove index.php from URL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-use-apache-bench-for-load-testing\/\">How to use Apache bench for Load Testing<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-debian\/\">How to Create Self-Signed SSL certificate for Apache<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-custom-404-page-in-apache\/\">How to Create Custom 404 Page in Apache<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>mod_security improves website security and protection. Here is how to install mod_security on CentOS 7 for Apache Web Server.<\/p>\n","protected":false},"author":1,"featured_media":2309,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[230],"class_list":["post-2303","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-install-mod_security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Install mod_security on CentOS - Ubiq BI<\/title>\n<meta name=\"description\" content=\"mod_security improves website security and protection. Here is how to install mod_security on CentOS for Apache Web Server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Install mod_security on CentOS - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"mod_security improves website security and protection. Here is how to install mod_security on CentOS for Apache Web Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-20T09:26:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-07T04:42:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"878\" \/>\n\t<meta property=\"og:image:height\" content=\"434\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How To Install mod_security on CentOS\",\"datePublished\":\"2020-11-20T09:26:08+00:00\",\"dateModified\":\"2025-10-07T04:42:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/\"},\"wordCount\":781,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1\",\"keywords\":[\"install mod_security\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/\",\"name\":\"How To Install mod_security on CentOS - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1\",\"datePublished\":\"2020-11-20T09:26:08+00:00\",\"dateModified\":\"2025-10-07T04:42:03+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"mod_security improves website security and protection. Here is how to install mod_security on CentOS for Apache Web Server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1\",\"width\":878,\"height\":434,\"caption\":\"how to install mod_security in centos 7\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-install-mod_security-on-centos-7\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Install mod_security on CentOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Install mod_security on CentOS - Ubiq BI","description":"mod_security improves website security and protection. Here is how to install mod_security on CentOS for Apache Web Server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How To Install mod_security on CentOS - Ubiq BI","og_description":"mod_security improves website security and protection. Here is how to install mod_security on CentOS for Apache Web Server.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-11-20T09:26:08+00:00","article_modified_time":"2025-10-07T04:42:03+00:00","og_image":[{"width":878,"height":434,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png","type":"image\/png"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How To Install mod_security on CentOS","datePublished":"2020-11-20T09:26:08+00:00","dateModified":"2025-10-07T04:42:03+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/"},"wordCount":781,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1","keywords":["install mod_security"],"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/","name":"How To Install mod_security on CentOS - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1","datePublished":"2020-11-20T09:26:08+00:00","dateModified":"2025-10-07T04:42:03+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"mod_security improves website security and protection. Here is how to install mod_security on CentOS for Apache Web Server.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1","width":878,"height":434,"caption":"how to install mod_security in centos 7"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How To Install mod_security on CentOS"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/install-mod_security-centos-7.png?fit=878%2C434&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-B9","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=2303"}],"version-history":[{"count":16,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2303\/revisions"}],"predecessor-version":[{"id":9722,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2303\/revisions\/9722"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/2309"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=2303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=2303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=2303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}