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.

error_logs per domain

Discussion in 'General Discussion' started by maqsium, Apr 19, 2015.

  1. maqsium

    maqsium Member

    Joined:
    Mar 27, 2015
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    I have dedicated server and have 13 busy sites running on it. I would like to know how can I see error_logs specific to domain?

    At the moment, I see all errors in /usr/local/apache/logs/error_logs
    But it is very difficult to identify which application/user is throwing these errors.
     
  2. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi,

    Typically the errors provide enough information to determine the account/domain, but there are a few that do not. You can also configure a local error log using the 'error_log' directive. How you implement this will be dependent on your PHP handler. If using suPHP, you may add the directive to your local 'php.ini' file. If you do not have one, you may create one. If using DSO you'll need to implement this through a '.htaccess' file with the the PHP directives prepended by 'php_val' or 'php_flag'.

    You can determine your PHP handler at WHM > Service Configuration > Configure PHP and suEXEC or with the command below from the root user:
    Code:
    /usr/local/cpanel/bin/rebuild_phpconf --current
    Thanks,
     
  3. ravijas

    ravijas Member

    Joined:
    Jul 24, 2014
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi,

    If php-SUEXEC enabled then just use "tail -f /usr/local/apache/logs/error_logs | grep username"
    username=replace with actual username.

    Thanks,

    Ravijas
     
  4. maqsium

    maqsium Member

    Joined:
    Mar 27, 2015
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    I'm using mod_fcgid with apache and suEXEC on Apache.

    My apache does not generate any domain/user specific application, it always gives PID and IP in each error, thats all. Nothing more than that, IP is simply my server's IP. I have 13 websites running on it and can't figure out which website is giving error.
     
  5. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi,

    Try temporarily switching to suPHP and then monitor logs.

    Thanks,
     
  6. maqsium

    maqsium Member

    Joined:
    Mar 27, 2015
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Its live server with huge traffic, it is not possible to move from mod_fcgid. Any other alternates?
     
  7. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I think that may be your best option. You can go back to the idea of a custom local PHP error log. You could also try a while loop that parses the Apache error log for these errors against lsof/netstat. You could also try manually running each page from the command line. fcgi by default just does not provide very verbose logging.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    The username of the account is typically present in the global /usr/local/apache/logs/error_log file. Could you provide an example of an entry that you can not determine the cause of?

    Thank you.
     
  9. maqsium

    maqsium Member

    Joined:
    Mar 27, 2015
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Here are few logs, I just see the IP of the my server.

    FYI, I'm using MPM Worker with mod_fcgid running wordpress sites.


    [Fri Apr 17 01:46:13.627246 2015] [fcgid:warn] [pid 31495:tid 139687846950656] [client xxx.xxx.xxx.xx:37962] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php5
    [Fri Apr 17 01:46:13.894606 2015] [fcgid:warn] [pid 31495:tid 139687469315840] [client xxx.xxx.xxx.xx:38138] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php5
    [Fri Apr 17 01:46:13.935566 2015] [fcgid:warn] [pid 31678:tid 139687700092672] [client xxx.xxx.xxx.xx:37963] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php5
    [Fri Apr 17 01:46:14.083410 2015] [fcgid:warn] [pid 31980:tid 139687794501376] [client xxx.xxx.xxx.xx:38139] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php5,
     
  10. maqsium

    maqsium Member

    Joined:
    Mar 27, 2015
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Micheal, I think you referring to the problem given in the log, rather, I would like to see which website/user is having those error. My objective is to show the website/username in the error log.
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page