Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Sep 2004
    Posts
    523

    Angry Modsec database 1GB of logs

    I have this database and has logs from 2007, how do I flush all the logs??

    the database is at /var/lib/mysql/modsec

    Thanks

  2. #2
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by bsasninja View Post
    I have this database and has logs from 2007, how do I flush all the logs??

    the database is at /var/lib/mysql/modsec
    An easy method would be to use phpMyAdmin via root WHM access to empty the table "modsec" within the database "modsec" -- all records are stored within the table.

    Please refer to the following WHM menu path and documentation:
    WHM: Main >> SQL Services >> phpMyAdmin

  3. #3
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default mod_security database very large on server.

    I just noticed that the mod_security database is well over a gigabyte on some of our servers.

    What's a good method of resetting, zeroing out this database, and by the way, what the heck is this database for?

    Thanks for any advice.

  4. #4
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: mod_security database very large on server

    Moderator Note: For ease of finding related information I have merged two threads discussing the "modsec" MySQL database.

    Quote Originally Posted by jols View Post
    I just noticed that the mod_security database is well over a gigabyte on some of our servers.

    What's a good method of resetting, zeroing out this database, and by the way, what the heck is this database for?

    Thanks for any advice.
    The MySQL database named "modsec" is used for storing log information from mod_security; if Mod Security is installed via EasyApache this data may be queried via the following menu path in WHM: Main >> Plugins >> Mod Security

    Please see the following post for information on how to empty or reset the mod_security MySQL database "modsec": cPanel Forums - View Single Post - Modsec database 1GB of logs

  5. #5
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Thanks. Is this just a matter of accessing the modsec database in phpMyAdmin and then clicking the trash can (empty) in the table row? And then afterward mod_security on the server will hum along just fine?

    Sorry, after all these years I am still a MySQL novice.

  6. #6
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Using phpMyAdmin to Empty or "reset" the Mod Security database in MySQL

    Quote Originally Posted by jols View Post
    Thanks. Is this just a matter of accessing the modsec database in phpMyAdmin and then clicking the trash can (empty) in the table row? And then afterward mod_security on the server will hum along just fine?
    Yes; using the action "Empty" will correctly reset the contents of the affected database table. The action should reset it as if there are no log entries stored and I believe it will work without issue.

    Here are the steps I would use to empty or reset the Mod Security database in MySQL:
    1.) Access the following menu path: WHM: Main >> SQL Services >> phpMyAdmin
    2.) Via the left-side browser frame navigate to the database named "modsec."
    3.) Via the left-side browser frame navigate to the table named "modsec" -- this will Browse the table contents.
    4.) Via the right-side browser frame click the red-colored action named "Empty." Please be careful; do not click "Drop."
    Last edited by cPanelDon; 02-19-2010 at 10:12 PM. Reason: Clarification

  7. #7
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Thanks very much for these detailed instructions. In using them I was able to take down my /var load from 86% full down to 71% full.

    This is something I had been struggling with every single night, i.e. keeping var from filling up.

    Thanks once again!

  8. #8
    Member
    Join Date
    Dec 2002
    Posts
    240

    Default

    Maybe it would be a good idea to have some sort of old data removal built into the mod_security plugin? So maybe it's set be the administrator saying logs older than 6 months are removed or something? Just a thought as seems to be topics about this issue once in a while. So why not add some automation to this so people are not having issues with data that is several years old.

  9. #9
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by VeZoZ View Post
    Maybe it would be a good idea to have some sort of old data removal built into the mod_security plugin? So maybe it's set be the administrator saying logs older than 6 months are removed or something? Just a thought as seems to be topics about this issue once in a while. So why not add some automation to this so people are not having issues with data that is several years old.
    I recommend to consider suggesting the desired enhancement (e.g., that could clean-up or expire old entries in the mod_security MySQL database) as a feature request in the following area on our forums; this will help bring more attention to your request and as more interest gathers it may be considered for implementation: Feature Requests for cPanel and WHM - cPanel Forums

    If needed, upon request we can relocate your post into the Feature Requests forum area as a new thread.

  10. #10
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Thanks cPanelDon.

    First, I'd much rather see cPanel.net come up with a way to set individual email account defaults, which is the leading cause of premature hair loss around here.

Similar Threads & Tags
Similar threads

  1. Replies: 4
    Last Post: 03-03-2011, 12:10 PM
  2. modsecparse.pl and modsec database
    By chips12 in forum Security
    Replies: 0
    Last Post: 11-24-2010, 05:20 AM
  3. modsec to iptables
    By sehh in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-15-2008, 01:27 AM
  4. modsec problem
    By Zion Ahead in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-27-2007, 06:47 PM
  5. Anybody know what this DBI ModSec means ???
    By simplestar in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-17-2006, 05:44 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube