rsutc

Well-Known Member
Oct 8, 2002
85
0
156
Mod_security no longer works on my server, and I'm seeking further advice:

What I have done recently:
Upgraded to PHP 5, then to MySQL 5. The problems started only after the latter. Of course there may have been cPanel-indused upgrades that affected this.

Symptoms:
1. The hourly cron job is sending me error messages:
/etc/cron.hourly/modsecparse.pl:

DBI connect('modsec:localhost','modsec',...) failed: Access denied for user 'modsec'@'localhost' (using password: YES) at /etc/cron.hourly/modsecparse.pl line 19
Unable to connect to mysql database at /etc/cron.hourly/modsecparse.pl line 19.


2. If I click on Mod Security in the WHM panel I get a page with a header but no other information,

3. There appears to be nothing in the modsec log (checked via the configserver firewall front end.)

I checked httpd.conf to ensure the modsec.conf is being included.

I uninstalled modsec from the plugin section and checked it instead in the Apache build options.

I tried the solution in

http://forums.cpanel.net/showthread.php?t=68886&highlight=modsec

"to fix the error remove the id field quotes in the query

$querystmnt = q{1 ORDER BY 'id' DESC LIMIT 0,30};

just like this

$querystmnt = q{1 ORDER BY id DESC LIMIT 0,30};
"
and I did make this change.

None of this matters.
 

Todd Mitchell

Well-Known Member
Staff member
Nov 13, 2006
301
1
243
Houston, TX
I recommend running through the easyapache build process, ensuring mod_security is enabled to allow mod_sec to get rebuilt and reinstalled successfully with the new mysql system.
 

rsutc

Well-Known Member
Oct 8, 2002
85
0
156
I recommend running through the easyapache build process, ensuring mod_security is enabled to allow mod_sec to get rebuilt and reinstalled successfully with the new mysql system.
Of course I had indeed already done this to no avail. The problems still manifest as of Friday. However, as of this morning, problems #1&2 are gone (one assumes with the weekend cpanel updates).

But calling up the mod security plugin, though it produces a page, gives no items for the table of incidents, which isn't right. I notice that the file in question that was repaired per the above, now contains the lines

# $querystmnt = q{1 ORDER BY 'id' DESC LIMIT 0,30};
$querystmnt = q{1 ORDER BY date DESC, id DESC LIMIT 0,30};

So this file has been replaced and a new query inserted instead of the old one-an apparent ack by cpanel that this was (part of) the problem. Any ideas now on how to get the database entries to show up on this page again?

And, while we're at it, i note that if I switch to Apache 2, the ruleset has to be redone. Is an appropriate new modsec ruleset installed when this update is done or....

Rick
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
724
15
243
Of course I had indeed already done this to no avail. The problems still manifest as of Friday. However, as of this morning, problems #1&2 are gone (one assumes with the weekend cpanel updates).
Actually those script are from the mod security part of easyapache and woudl only change if easyapache is run.

But calling up the mod security plugin, though it produces a page, gives no items for the table of incidents, which isn't right. I notice that the file in question that was repaired per the above, now contains the lines

# $querystmnt = q{1 ORDER BY 'id' DESC LIMIT 0,30};
$querystmnt = q{1 ORDER BY date DESC, id DESC LIMIT 0,30};

So this file has been replaced and a new query inserted instead of the old one-an apparent ack by cpanel that this was (part of) the problem. Any ideas now on how to get the database entries to show up on this page again?

And, while we're at it, i note that if I switch to Apache 2, the ruleset has to be redone. Is an appropriate new modsec ruleset installed when this update is done or....

Rick
This was resolved a long time ago before ea3, could you submit a ticket 'Attn: Dan' so I can investigate why you're still having it?

thanks