Internal Server Errors not appearing in CPanel Error Log

Xavior82

Active Member
PartnerNOC
Oct 5, 2006
30
0
156
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!
 

zamrg

Active Member
Oct 17, 2010
34
0
56
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.
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
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.
 

zamrg

Active Member
Oct 17, 2010
34
0
56
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.
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator