Error on ModSecurity™ Tools

Masimo

Well-Known Member
Nov 19, 2015
70
2
8
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

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

Code:
/usr/local/cpanel/scripts/setup_modsec_db
Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
That's the output from the command. However, could you verify if the error message you reported is still visible?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
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.
 
  • Like
Reactions: Masimo

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
I am happy to see the issue is now resolved. Thank you for updating us with the outcome.