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!

mod_security broken

Discussion in 'Security' started by rsutc, Jan 12, 2008.

  1. rsutc

    rsutc Well-Known Member

    Joined:
    Oct 8, 2002
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. ToddShipway

    ToddShipway Well-Known Member

    Joined:
    Nov 13, 2006
    Messages:
    300
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. rsutc

    rsutc Well-Known Member

    Joined:
    Oct 8, 2002
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    156
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    715
    Likes Received:
    5
    Trophy Points:
    243
    Actually those script are from the mod security part of easyapache and woudl only change if easyapache is run.

    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
     
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