The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

modsecparse.pl / mysql issues

Discussion in 'Security' started by katmai, Jan 6, 2008.

  1. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    hi,

    i moved mysql to another drive, and i am getting these errors

    /etc/cron.hourly/modsecparse.pl:

    DBI connect('modsec:localhost','modsec',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /etc/cron.hourly/modsecparse.pl line 19
    Unable to connect to mysql database at /etc/cron.hourly/modsecparse.pl line 19.

    [root@viper ~]# ls -la /var/lib/mysql/mysql.sock
    lrwxrwxrwx 1 root root 23 Jan 6 20:11 /var/lib/mysql/mysql.sock -> /home3/mysql/mysql.sock


    the socket exists.

    in cpanel - service manager mysql looks as down, and eximstats the same.

    any idea where is the config for modsec and chkserv so that i could set the new mysql.sock location? maybe that will work.
     
  2. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    already did that in the first place.

    as you already know the socket gets created once you start mysql. so it would be impossible for me to create a symlink to an inexistent socket.
     
  3. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    lol i wrote in advance:))
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    One thing, make sure you have set the datadir and socket directives in /etc/my.cnf to the real locations (not the symlink) and restart mysql.
     
  5. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    bumping the thread.
     
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Does command line mysql still work?

    Try logging into MySQL as different users. Log in as the mod sec user.
     
  7. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    We see this from time to time where modsec works fine but access to the logging db for the whm plugin is missing.

    Code:
    vi /etc/cron.hourly/modsecparse.pl
    #Copy the password. Close out.

    Code:
    mysql
    create database modsec;
    grant all privileges on modsec.* to modsec@localhost identified by 'thepassword';
    quit
     
Loading...

Share This Page