{"id":13696,"date":"2024-11-27T18:06:47","date_gmt":"2024-11-27T12:36:47","guid":{"rendered":"https:\/\/www.skynats.com\/?p=13696"},"modified":"2025-10-23T16:30:01","modified_gmt":"2025-10-23T11:00:01","slug":"how-to-fix-modsec-sqlite-file-size-issue-in-cpanel","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/","title":{"rendered":"How to fix modsec.sqlite file size issue in cPanel"},"content":{"rendered":"\n<p>If you&#8217;re managing a cPanel server, you might come across a situation where the modsec.sqlite file located at <code>\/var\/cpanel\/modsec\/<\/code> becomes excessively large. This file stores logs from ModSecurity, and without proper maintenance, it can take up a lot of disk space, affecting the server&#8217;s performance. If you&#8217;re wondering how to fix the modsec.sqlite file size issue in cPanel, regular maintenance and log management are essential to prevent it from growing too large.<\/p>\n\n\n\n<p>In this blog, we\u2019ll walk through a step-by-step process to clean up the modsec.sqlite file, recreate it safely.<\/p>\n\n\n\n<p>ModSecurity logs every web request that triggers its rules into the modsec.sqlite database. While this is useful for monitoring, the file can grow uncontrollably if left unchecked, sometimes exceeding tens or hundreds of GBs. This growth can lead to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Reduced available disk space.<\/li>\n\n\n\n<li>Increased backup sizes and times.<\/li>\n\n\n\n<li>Potential performance degradation.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-normal-font-size\" id=\"h-step-by-step-solution-to-fix-modsec-sqlite-file-size-issue-in-cpanel\">Step-by-Step Solution to fix modsec.sqlite file size issue in cPanel <\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-normal-font-size\" id=\"h-step-1-stop-the-tailwatchd-service\"><strong>Step 1: Stop the tailwatchd Service<\/strong><\/h3>\n\n\n\n<p>The tailwatchd service actively monitors logs and might lock the modsec.sqlite file. Before making any changes, stop this service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/restartsrv_tailwatchd --stop<\/code><\/pre>\n\n\n\n<p>This ensures the database is not in use during the cleanup process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-normal-font-size\"><strong>Step 2: Backup the Current Database<\/strong><\/h3>\n\n\n\n<p>Before proceeding, create a backup of the existing database. This allows you to restore it if needed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv \/var\/cpanel\/modsec\/modsec.sqlite \/var\/cpanel\/modsec\/modsec.sqlite.old1<\/code><\/pre>\n\n\n\n<p>This command renames the file, effectively removing it from active use while preserving its content.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-normal-font-size\"><strong>Step 3: Recreate a Fresh Database<\/strong><\/h3>\n\n\n\n<p>Generate a new, empty modsec.sqlite database with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/setup_modsec_db<\/code><\/pre>\n\n\n\n<p>This initializes a clean database for ModSecurity, ensuring that logs start fresh.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-normal-font-size\"><strong>Step 4: Restart the tailwatchd Service<\/strong><\/h3>\n\n\n\n<p>Once the new database is set up, restart the tailwatchd service to resume normal operations:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/restartsrv_tailwatchd --start<\/code><\/pre>\n\n\n\n<p>This brings ModSecurity logging back online, now utilizing the clean database.<\/p>\n\n\n\n<p>Managing the size of the modsec.sqlite file is essential to maintaining a healthy <a href=\"https:\/\/cpanel.net\/\">cPanel<\/a> server. Following these steps, you can safely clean up the database, recreate it, and implement preventive measures to avoid future issues.<\/p>\n\n\n\n<p>If you need assistance with How to fix modsec.sqlite file size issue in cPanel, contacting the <a href=\"https:\/\/www.skynats.com\/blog\/\">Skynats<\/a> for support can provide valuable guidance.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re managing a cPanel server, you might come across a situation where the modsec.sqlite file located at \/var\/cpanel\/modsec\/ becomes excessively large. This file stores logs from ModSecurity, and without proper maintenance, it can take up a lot of disk space, affecting the server&#8217;s performance. If you&#8217;re wondering how to fix the modsec.sqlite file size [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18,933,932],"class_list":["post-13696","post","type-post","status-publish","format-standard","hentry","category-blog","tag-cpanel","tag-how-to-fix-modsec-sqlite-file-size-issue-in-cpanel","tag-modsec-sqlite-file"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to fix modsec.sqlite file size issue in cPanel<\/title>\n<meta name=\"description\" content=\"Learn how to fix modsec.sqlite file size issue in cPanel with simple steps to manage disk space and optimize server performance.\" \/>\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.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to fix modsec.sqlite file size issue in cPanel\" \/>\n<meta property=\"og:description\" content=\"Learn how to fix modsec.sqlite file size issue in cPanel with simple steps to manage disk space and optimize server performance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"Server Management Services | Cloud Management | Skynats\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/skynats\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-27T12:36:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-23T11:00:01+00:00\" \/>\n<meta name=\"author\" content=\"Jishnu V\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:site\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jishnu V\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/\"},\"author\":{\"name\":\"Jishnu V\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/c63611da5e22d216e38d8658e5a605c5\"},\"headline\":\"How to fix modsec.sqlite file size issue in cPanel\",\"datePublished\":\"2024-11-27T12:36:47+00:00\",\"dateModified\":\"2025-10-23T11:00:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/\"},\"wordCount\":362,\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"keywords\":[\"cpanel\",\"How to fix modsec.sqlite file size issue in cPanel\",\"modsec.sqlite file\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/\",\"name\":\"How to fix modsec.sqlite file size issue in cPanel\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-11-27T12:36:47+00:00\",\"dateModified\":\"2025-10-23T11:00:01+00:00\",\"description\":\"Learn how to fix modsec.sqlite file size issue in cPanel with simple steps to manage disk space and optimize server performance.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to fix modsec.sqlite file size issue in cPanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"name\":\"Server Management Services | Cloud Management | Skynats\",\"description\":\"Server Management and Cloud Management\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\",\"name\":\"Skynats Technologies\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"contentUrl\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"width\":989,\"height\":367,\"caption\":\"Skynats Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/skynats\",\"https:\\\/\\\/x.com\\\/skynatstech\",\"https:\\\/\\\/www.instagram.com\\\/skynatstech\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/skynats-technologies\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCvTAjrFJ4_E2MJKwlDHomlg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/c63611da5e22d216e38d8658e5a605c5\",\"name\":\"Jishnu V\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9fc7882cfbe811c2c069669ed9a43c27a8b4f7e013fc7e9d539199f807dc7ab1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9fc7882cfbe811c2c069669ed9a43c27a8b4f7e013fc7e9d539199f807dc7ab1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9fc7882cfbe811c2c069669ed9a43c27a8b4f7e013fc7e9d539199f807dc7ab1?s=96&d=mm&r=g\",\"caption\":\"Jishnu V\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to fix modsec.sqlite file size issue in cPanel","description":"Learn how to fix modsec.sqlite file size issue in cPanel with simple steps to manage disk space and optimize server performance.","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.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to fix modsec.sqlite file size issue in cPanel","og_description":"Learn how to fix modsec.sqlite file size issue in cPanel with simple steps to manage disk space and optimize server performance.","og_url":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/","og_site_name":"Server Management Services | Cloud Management | Skynats","article_publisher":"https:\/\/www.facebook.com\/skynats","article_published_time":"2024-11-27T12:36:47+00:00","article_modified_time":"2025-10-23T11:00:01+00:00","author":"Jishnu V","twitter_card":"summary_large_image","twitter_creator":"@skynatstech","twitter_site":"@skynatstech","twitter_misc":{"Written by":"Jishnu V","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/#article","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/"},"author":{"name":"Jishnu V","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/c63611da5e22d216e38d8658e5a605c5"},"headline":"How to fix modsec.sqlite file size issue in cPanel","datePublished":"2024-11-27T12:36:47+00:00","dateModified":"2025-10-23T11:00:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/"},"wordCount":362,"publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"keywords":["cpanel","How to fix modsec.sqlite file size issue in cPanel","modsec.sqlite file"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/","url":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/","name":"How to fix modsec.sqlite file size issue in cPanel","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/#website"},"datePublished":"2024-11-27T12:36:47+00:00","dateModified":"2025-10-23T11:00:01+00:00","description":"Learn how to fix modsec.sqlite file size issue in cPanel with simple steps to manage disk space and optimize server performance.","breadcrumb":{"@id":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.skynats.com\/blog\/how-to-fix-modsec-sqlite-file-size-issue-in-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.skynats.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to fix modsec.sqlite file size issue in cPanel"}]},{"@type":"WebSite","@id":"https:\/\/www.skynats.com\/blog\/#website","url":"https:\/\/www.skynats.com\/blog\/","name":"Server Management Services | Cloud Management | Skynats","description":"Server Management and Cloud Management","publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.skynats.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.skynats.com\/blog\/#organization","name":"Skynats Technologies","url":"https:\/\/www.skynats.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","contentUrl":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","width":989,"height":367,"caption":"Skynats Technologies"},"image":{"@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/skynats","https:\/\/x.com\/skynatstech","https:\/\/www.instagram.com\/skynatstech\/","https:\/\/www.linkedin.com\/company\/skynats-technologies","https:\/\/www.youtube.com\/channel\/UCvTAjrFJ4_E2MJKwlDHomlg"]},{"@type":"Person","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/c63611da5e22d216e38d8658e5a605c5","name":"Jishnu V","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9fc7882cfbe811c2c069669ed9a43c27a8b4f7e013fc7e9d539199f807dc7ab1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9fc7882cfbe811c2c069669ed9a43c27a8b4f7e013fc7e9d539199f807dc7ab1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9fc7882cfbe811c2c069669ed9a43c27a8b4f7e013fc7e9d539199f807dc7ab1?s=96&d=mm&r=g","caption":"Jishnu V"}}]}},"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/13696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=13696"}],"version-history":[{"count":1,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/13696\/revisions"}],"predecessor-version":[{"id":16229,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/13696\/revisions\/16229"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=13696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=13696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=13696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}