The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error on ModSecurity™ Tools

Discussion in 'Security' started by Masimo, Apr 4, 2016.

  1. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    I have following error on "ModSecurity™ Tools":
    Error: The following exception has occurred: API failure: The system could not read the modsec database password file “/var/cpanel/modsec_db_pass”:

    NOTE: I using remote mysql server.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    info [setup_modsec_db] Initialized ModSecurity™ database.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    Yes, its still exists.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you verify if the "/var/cpanel/modsec_db_pass" file exists on this system? If not, please create this file:

    Code:
    touch /var/cpanel/modsec_db_pass
    chmod 0600 /var/cpanel/modsec_db_pass
    Then, populate this file with a single line containing a randomly generated password. Here's an example (note you should use your own randomly generated password):

    Code:
    # cat /var/cpanel/modsec_db_pass
    RandomPassword
    
    Then, update the password for the database to the one in that file:

    Code:
    mysql mysql
    Code:
    mysql> update user set Password=password('RandomPassword') where User='modsec';
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1  Changed: 1  Warnings: 0
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> quit;
    Bye
    Thank you.
     
    Masimo likes this.
  7. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    Thank you very much, problem resolved :)
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page