Internal server error 500 testing my server admin skill (terrible BTW) to the max

Roy@ENHOST

Well-Known Member
Mar 5, 2002
487
0
316
Los Angeles California
Hi guys,

I have been pretty confused about a server prenomenon lately.
When I request my URL from my browser, everything is OK.
But when I try to request my URL from a PHP script, it will give me an error 500.

When I tail my error_log, this is what I get.

[Sat Oct 23 18:28:22 2004] [error] [client 66.235.180.123] File does not exist: /home/cpanelsd/public_html/500.shtml
[Sat Oct 23 18:28:35 2004] [error] [client 66.235.180.123] File does not exist: /home/cpanelsd/public_html/500.shtml
[Sat Oct 23 18:28:40 2004] [error] [client 66.235.180.123] File does not exist: /home/cpanelsd/public_html/500.shtml
[Sat Oct 23 18:28:53 2004] [error] [client 66.235.180.123] File does not exist: /home/cpanelsd/public_html/500.shtml
[Sat Oct 23 18:29:00 2004] [error] [client 66.235.180.123] File does not exist: /home/cpanelsd/public_html/500.shtml
[Sat Oct 23 18:29:05 2004] [error] [client 66.235.180.123] File does not exist: /home/cpanelsd/public_html/500.shtml


Can any veteran server admins out there tell me what I should look out for?
I tried HTTPD.conf, reboot apache, change some php.ini , you name it I tried it.
But there is a limit to my poor server admin skill.
That is why I need to get some enlightenment from you guys.
 

Aric1

Well-Known Member
Oct 15, 2003
324
0
166
cPanel Access Level
DataCenter Provider
It is looking for a custom #500 error message file for the cpanelsd account.

The error you note itself isn't a big deal, you can create a 500.shtml custom error document in CPANEL to rid yourself of that particular error.

However, a 500 error itself is an Internal Server Error which can be caused by many things... incorrect permissions on CGI-BIN files, an incorrect directive in a user's .htaccess file, etc.
 

Roy@ENHOST

Well-Known Member
Mar 5, 2002
487
0
316
Los Angeles California
Well I am actually concerned about the internal server error itself.
This whole thing started after I installed phpsuexec I think.
After I uninstalled it, the errors persists.

One thing I noticed is that my public_html kept chmodding to 750 no matter how many times I chmodded it 755. I suspect they are related to phpsuexec.

Aric1 said:
It is looking for a custom #500 error message file for the cpanelsd account.

The error you note itself isn't a big deal, you can create a 500.shtml custom error document in CPANEL to rid yourself of that particular error.

However, a 500 error itself is an Internal Server Error which can be caused by many things... incorrect permissions on CGI-BIN files, an incorrect directive in a user's .htaccess file, etc.
 

Aric1

Well-Known Member
Oct 15, 2003
324
0
166
cPanel Access Level
DataCenter Provider
Your public_html should be 750, especially with phpsuexec installed since PHP runs as the user, "nobody" should not have to access your files.

With phpsuexec you can't put PHP directives in .htaccess like you normally would. They have to go into a php.ini file in that directory instead.

Any files or directories chmodded over 755 will produce errors with phpsuexec.
 

Roy@ENHOST

Well-Known Member
Mar 5, 2002
487
0
316
Los Angeles California
I am aware of that.
But public_html kept getting chmodded 750 even after I uninstalled phpsuexec.
I suspect Cpanel CRONned a process to do that, maybe Im just paranoid. :mad:

And the funny thing is that when I access the site from the browser, it displays OK.
The error only appears when I used PHP script to access/import the page from that site.
A DNS error maybe? :cool:

Aric1 said:
Your public_html should be 750, especially with phpsuexec installed since PHP runs as the user, "nobody" should not have to access your files.

With phpsuexec you can't put PHP directives in .htaccess like you normally would. They have to go into a php.ini file in that directory instead.

Any files or directories chmodded over 755 will produce errors with phpsuexec.
 

Roy@ENHOST

Well-Known Member
Mar 5, 2002
487
0
316
Los Angeles California
I think my best bet would be to check out some error logs.
Is there any way that I can find a more detailed error log?

The apache error_log doesn't say anything.
 

arcane

Member
Oct 25, 2004
16
0
151
Hi,

I suggest downgrading to PHP 4.3.8 as I have, and the 500 Internal Server Error for one of my php scripts works fine now.
 

Roy@ENHOST

Well-Known Member
Mar 5, 2002
487
0
316
Los Angeles California
Guys,

I have solved the problem.
It was due to overhardening of server.

The mod_security prevents PHP scripts from getting contents from the sites on my server.
 

Roy@ENHOST

Well-Known Member
Mar 5, 2002
487
0
316
Los Angeles California
Its a very good article although it's not going to help in my situation because it was due to Mod_security.

The first sentence:
All Linux/Cpanel servers are now running phpsuexec
I will have to disagree with that. :D