• Modsecurity cron problem.

    Some times you got the following error when trying to access mod_security from the cpanel :
    ‘The mod_security plugin could not connect to the database. Please verify that MySQL is running. Error: Access denied for user ‘modsec’@’X.X.X.X’ (using password: YES)’

    The error occurs due to the password being mis configured in the file /etc/cron.hourly/modsecparse.pl .

    To overcome this problem ,do the following Steps:

    1) open the file /etc/cron.hourly/modsecparse.pl. You can find the following details in the file :

    my $dbhost     = ‘localhost’;
    my $dbuser     = ‘modsec’;
    my $dbpassword = ‘Password-Here’;
    my $dbname     = ‘modsec’;
    my $tblname    = ‘modsec’;

    Take the password from the file ,then connect to mysql DB server and update the password there:
    #mysql
    #use mysql;
    #UPDATE user SET Password=PASSWORD(‘Password-Here’) WHERE User=’modsec’;

    This will reset the password for the DB modsec to the original password  somepassword in the file /etc/cron.hourly/modsecparse.pl .
    run the following command to ensure the DB is fixed :

    # perl -w /etc/cron.hourly/modsecparse.pl

    If it runs without error the problem is sorted.

     

     

    Categories: Cpanel

    Comments are currently closed.