{"id":22,"date":"2015-04-27T08:27:42","date_gmt":"2015-04-27T08:27:42","guid":{"rendered":"http:\/\/betakb.veeble.org\/?p=22"},"modified":"2025-03-10T12:16:58","modified_gmt":"2025-03-10T06:46:58","slug":"disabling-mod-security-for-a-domain-in-cpanel","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/disabling-mod-security-for-a-domain-in-cpanel\/","title":{"rendered":"How to disable Mod security for a particular domain in cPanel"},"content":{"rendered":"<p>Mod_security is an open-source Apache module. This can be considered a firewall for web applications. It secures the system from attackers. We use mod_security1 for Apache1.x and Apache 2.x uses mod_security2. In the case of mod_security1, we can disable it for a domain using the .htaccess file.<\/p>\n<p>If you want to disable mod_sec for one domain then add the following line in .htaccess<\/p>\n<pre>SecFilterEngine Off\n<\/pre>\n<p>However, we can&#8217;t block mod_security2 via .htaccess on a domain basis.<\/p>\n<p>The following steps can be used to disable mod_security2 rule for one domain in cPanel servers.<\/p>\n<p>1. Make the directory &#8220;\/usr\/local\/apache\/conf\/userdata\/std\/2\/username\/domain.com&#8221;<\/p>\n<p>2. Create a file &#8220;<a href=\"https:\/\/docs.plesk.com\/en-US\/obsidian\/advanced-administration-guide-linux\/virtual-hosts-configuration\/virtual-hosts-and-hosting-types\/virtual-host-configuration-files.72064\/\" target=\"_blank\" rel=\"noopener\">vhost.conf<\/a>&#8221; in the above location<\/p>\n<p>3. Add the following lines\u00a0:<\/p>\n<pre>&lt;IfModule mod_security2.c&gt;\nSecRuleEngine Off\n&lt;\/IfModule&gt;\n<\/pre>\n<p>To disable mod_secuirty for a particular location\u00a0:<\/p>\n<pre>&lt;LocationMatch specify_the_path_here&gt;\n&lt;IfModule mod_security2.c&gt;\nSecRuleEngine Off\n&lt;\/IfModule&gt;\n&lt;\/LocationMatch&gt;\n<\/pre>\n<p>To disable a particular mod_secuirty rule\u00a0:<\/p>\n<pre>&lt;IfModule mod_security2.c&gt;\nSecRuleRemoveById give_ruleID_here\n&lt;\/IfModule&gt;\n<\/pre>\n<p>Please make sure run the following script after making the changes.<\/p>\n<pre>\/scripts\/ensure_vhost_includes --user=username\n<\/pre>\n<p>This script will uncomment the following line in apache configuration. It will customise the virtual host to use the particular include file and will restart apache.<\/p>\n<pre>Include \"\/usr\/local\/apache\/conf\/userdata\/std\/2\/username\/domain.com\/*.conf\"<\/pre>\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-ab76d95f wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">WordPress Made Simple.<\/h3><p class=\"uagb-cta__desc\">No more server headaches or confusing configurations. Get your WordPress site up and running in minutes with Veeble&#8217;s intuitive managed hosting.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/managed-wordpress\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Get Started Now<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mod_security is an open-source Apache module. This can be considered a firewall for web applications. It secures the system from attackers. We use mod_security1 [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":7962,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"class_list":["post-22","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-disable-Mod-security-for-a-particular-domain-in-cPanel.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Vipin Raj","author_link":"https:\/\/www.veeble.com\/kb\/author\/vipin\/"},"uagb_comment_info":0,"uagb_excerpt":"Mod_security is an open-source Apache module. This can be considered a firewall for web applications. It secures the system from attackers. We use mod_security1 [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":8,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":7980,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/22\/revisions\/7980"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/7962"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}