{"id":277,"date":"2011-10-27T13:08:34","date_gmt":"2011-10-27T13:08:34","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2011\/10\/27\/what-is-modsecurity-and-why-is-it-important\/"},"modified":"2025-05-05T12:30:14","modified_gmt":"2025-05-05T16:30:14","slug":"what-is-modsecurity-and-why-is-it-important","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/","title":{"rendered":"Learning About Mod_security and Disabling Mod_security"},"content":{"rendered":"\n<p><strong>Mod_security<\/strong> is an apache module that helps to protect your website from various attacks. It is used to block commonly known exploits by use of regular expressions and rule sets and is enabled on all InMotion web hosting plans. <a href=\"https:\/\/www.inmotionhosting.com\/support\/security\/how-to-change-your-modsecurity-audit-log-level\/\"><strong>Mod_Security<\/strong><\/a> can potentially block common code injection attacks which strengthens the security of the server. If you need to disable the mod_security rules we can show you how, and help you do so.<\/p>\n\n\n\n<p>When coding a dynamic website, sometimes users forget to write code to help prevent hacks by doing things such as validating input.<strong> Mod_security<\/strong> can help in some cases those users that run sites that don&#8217;t have security checks in their code.<\/p>\n\n\n\n<p>This is a simple SQL injection where visiting this would cause the database to DROP and delete the users table from the database:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.webapp.com\/login.php?username=admin'&#8221;>DROP%20TABLE%20users&#8211;\n<\/div><\/figure>\n\n\n\n<p>If you are running <strong> Mod_security<\/strong> on your server it will block this from running. Typically, you would see a 406 error in this case if mod_security is enabled. To read more about <a href=\"\/support\/website\/error-numbers\/406-error-not-acceptable\/\">406 errors<\/a> read our article. You set up rules for <strong> Mod_security<\/strong> to check http requests against and determine if a threat is present.<\/p>\n\n\n\n<p>Recognizing <strong> Mod_security<\/strong> is pretty easy. Any website that calls a string forbidden by a mod_security rule will give a 406 error instead of displaying the page. On our shared servers, if you would like to disable mod_security for one or all of your domains, this can be done using our <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/how-to-disable-modsecurity-cpanel\/\">Modsec manager plugin for cPanel<\/a>.<\/p>\n\n\n\n<p>If you&#8217;d like to simply disable a certain rule that is being triggered instead of disabling mod_security for the entire domain, please contact our <a href=\"\/support\/amp\/how-to-get-great-technical-support\/\">Live Support<\/a> team.<\/p>\n\n\n\n<p>If you are a <a href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\">VPS<\/a> or <a href=\"https:\/\/www.inmotionhosting.com\/dedicated-servers\">Dedicated hosting<\/a> customer you can disable mod_security for the entire server as well. This can be accomplished in WHM by selecting &#8220;No Configuration&#8221; from <em>WHM &gt;Mod Security<\/em>. Please take note that mod_security is enabled as an extra layer of security and removing it can expose you to potential risks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Manually Disabling Mod_Security on a VPS or Dedicated Server<\/h2>\n\n\n\n<p>Some applications may require you to disable mod_security for them to function correctly. This is perfectly fine and since the set_modsec tool is only available on <a href=\"https:\/\/www.inmotionhosting.com\/shared-hosting\">shared servers<\/a> you will need to disable mod_security for a single domain:<\/p>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><a href=\"\/support\/server\/ssh\/do-you-provide-ssh-access\/\">SSH into the server<\/a> and open the httpd.conf file. Find the VirtualHost entry for that specific domain. Uncomment out the include line that looks like this:<br><pre>Include \"\/usr\/local\/apache\/conf\/userdata\/std\/2\/USERNAME\/DOMAIN.COM\/*.conf\"<\/pre><br><div class=\"alert alert-warning\" role=\"alert\"><strong>NOTE:<\/strong> this line tells Apache to INCLUDE into the VirtualHost config ANY file ending in .conf. This is an advanced task and if you are unfamiliar with the command line, we suggest you contact our support team for further assistance.<\/div><\/li>\n\n\n\n<li>Copy the line you uncommented and mkdir<br><pre>mkdir -p \/usr\/local\/apache\/userdata\/std\/2\/USER\/DOMAIN.COM<\/pre><\/li>\n\n\n\n<li>Insert the rule to turn off mod_security<br><pre>echo \"SecRuleEngine Off\" &gt; \/usr\/local\/apache\/userdata\/std\/2\/USER\/DOMAIN.COM\/modsec.conf<\/pre><\/li>\n\n\n\n<li>Restart Apache<br><pre>service httpd restart<\/pre><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Disabling Specific Mod_Security Rules on VPS and Dedicated<\/h2>\n\n\n\n<p>Using SecRuleRemoveById, you can disable individual mod_security rules. To find the ID to disable, you need to look in the apache error log (\/usr\/local\/apache\/logs\/error_log). You can grep for the domain that is having the problem and ModSecurity to find the problem:<\/p>\n\n\n\n<pre>grep domain.com \/usr\/local\/apache\/logs\/error_log | grep ModSecurity<\/pre>\n\n\n\n<p>These lines will provide a section that looks like this: [id &#8220;950004&#8221;] The number is the ID of the ModSecurity rule that you will disable. You can then enter the following line in an applicable .htaccess file (replacing the ID of your matched error with the 950004 example used below):<\/p>\n\n\n\n<pre>SecRuleRemoveById 950004<\/pre>\n\n\n\n<div class=\"alert alert-warning\" role=\"alert\"><strong>Note:<\/strong> Do NOT include the SecRuleEngine Off line, as this will totally disable ModSecurity.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mod_security is an apache module that helps to protect your website from various attacks. It is used to block commonly known exploits by use of regular expressions and rule sets and is enabled on all InMotion web hosting plans. Mod_Security can potentially block common code injection attacks which strengthens the security of the server. If<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\"> Read More ><\/a><\/p>\n","protected":false},"author":56983,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4299],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-security"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learning About Mod_security and Disabling Mod_security<\/title>\n<meta name=\"description\" content=\"Learn what mod_security is, why it is important and how to disable it if needed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learning About Mod_security and Disabling Mod_security\" \/>\n<meta property=\"og:description\" content=\"Learn what mod_security is, why it is important and how to disable it if needed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-27T13:08:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-05T16:30:14+00:00\" \/>\n<meta name=\"author\" content=\"Carrie Smaha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@carriesmaha\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carrie Smaha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\"},\"author\":{\"name\":\"Carrie Smaha\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\"},\"headline\":\"Learning About Mod_security and Disabling Mod_security\",\"datePublished\":\"2011-10-27T13:08:34+00:00\",\"dateModified\":\"2025-05-05T16:30:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\"},\"wordCount\":613,\"commentCount\":18,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\",\"name\":\"Learning About Mod_security and Disabling Mod_security\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2011-10-27T13:08:34+00:00\",\"dateModified\":\"2025-05-05T16:30:14+00:00\",\"description\":\"Learn what mod_security is, why it is important and how to disable it if needed.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learning About Mod_security and Disabling Mod_security\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\",\"name\":\"Carrie Smaha\",\"description\":\"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/carriesmaha\/\",\"https:\/\/x.com\/carriesmaha\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learning About Mod_security and Disabling Mod_security","description":"Learn what mod_security is, why it is important and how to disable it if needed.","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:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/","og_locale":"en_US","og_type":"article","og_title":"Learning About Mod_security and Disabling Mod_security","og_description":"Learn what mod_security is, why it is important and how to disable it if needed.","og_url":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2011-10-27T13:08:34+00:00","article_modified_time":"2025-05-05T16:30:14+00:00","author":"Carrie Smaha","twitter_card":"summary_large_image","twitter_creator":"@carriesmaha","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Carrie Smaha","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/"},"author":{"name":"Carrie Smaha","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8"},"headline":"Learning About Mod_security and Disabling Mod_security","datePublished":"2011-10-27T13:08:34+00:00","dateModified":"2025-05-05T16:30:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/"},"wordCount":613,"commentCount":18,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/","url":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/","name":"Learning About Mod_security and Disabling Mod_security","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2011-10-27T13:08:34+00:00","dateModified":"2025-05-05T16:30:14+00:00","description":"Learn what mod_security is, why it is important and how to disable it if needed.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/security\/what-is-modsecurity-and-why-is-it-important\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Learning About Mod_security and Disabling Mod_security"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8","name":"Carrie Smaha","description":"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.","sameAs":["https:\/\/www.linkedin.com\/in\/carriesmaha\/","https:\/\/x.com\/carriesmaha"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4299,"name":"Security","slug":"security","link":"https:\/\/www.inmotionhosting.com\/support\/security\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/56983"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=277"}],"version-history":[{"count":10,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":130193,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/277\/revisions\/130193"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}