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.

Internal Server Errors not appearing in CPanel Error Log

Discussion in 'General Discussion' started by Xavior82, Oct 17, 2010.

  1. Xavior82

    Xavior82 Active Member
    PartnerNOC

    Joined:
    Oct 5, 2006
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Montreal
    Hi,

    I have noticed that errors of the kind: Internal Server Error (error code: 500) do not have their details listed in a user's CPanel Error Logs.

    Instead, I need to check /etc/httpd/logs/error_log as root. This makes it much more difficult for the end-user to debug their own problems and renders the View Error Log feature in the CPanel quite limited in my opinion.

    Maybe I have it set up wrong? Is there a way I can list these errors in the user's CPanel as well?

    I am using Apache 2.2x
    The error where I initially noticed the problem was being triggered by an error in a RewriteRule on an .htaccess file.

    Can anyone let me know if I can have these errors shown to the user in their Error Log?

    Thanks!
     
  2. zamrg

    zamrg Active Member

    Joined:
    Oct 17, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    I was surprised to find this on my installation too.

    I was testing suphp by chmoding the file to g+w and I spent a good 20 minutes trying to find out where the 500 internal server error was being logged to.

    I'm not sure whether cPanel will overwrite the vhost template if you modify it, nor whether this would mess up stats generation or anything else, but you can try this.

    Code:
    Edit your /var/cpanel/templates/apache2/vhost.default add a error_log directive within the logstyle block.
    
    ErrorLog [% serverroot %]/domlogs/[% vhost.log_servername %]-error_log
    ... then again, I'm rather new to WHS/cPanel so perhaps this is the wrong way to go about it, or perhaps there's an option somewhere in the frontend.
     
    #2 zamrg, Oct 18, 2010
    Last edited: Oct 18, 2010
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You'd need to copy vhost.default to vhost.local in that path (/var/cpanel/templates/apache2/) and modify vhost.local

    Changes made to vhost.default will be overwritten on updates.
     
  4. zamrg

    zamrg Active Member

    Joined:
    Oct 17, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    thanks, works for me.

    Any particular reason this isn't default? It kinda makes sense for clients to be able to debug their own error log.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page