Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Error on ModSecurity™ Tools

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

  1. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    70
    Likes Received:
    2
    Trophy Points:
    8
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Please let us know if the following command addresses this issue:

    Code:
    /usr/local/cpanel/scripts/setup_modsec_db
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    70
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    info [setup_modsec_db] Initialized ModSecurity™ database.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    That's the output from the command. However, could you verify if the error message you reported is still visible?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    70
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    Yes, its still exists.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Masimo likes this.
  7. Masimo

    Masimo Well-Known Member

    Joined:
    Nov 19, 2015
    Messages:
    70
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Tbilisi
    cPanel Access Level:
    Root Administrator
    Thank you very much, problem resolved :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice