Koozali.org: home of the SME Server

500 internal server error with cgi scripts

Neil Bryan

500 internal server error with cgi scripts
« on: December 19, 2000, 09:30:29 PM »
I.ve updated to 4.0.1.
In /home/e-smith/files/primary/cgi-bin/ have the file Edit1.cgi contents:

#!/usr/bin/perl

print "content-type: text/html\n\n";

print "CGI Test\n";
print "\n";
print "

Hello World!

\n";
print "\n\n";

I ran chmod 755 Edit2.cgi (too much I know but needed to try).
Ran:
perl /home/e-smith/files/primary/cgi-bin/Edit2.cgi
and output looked fine - no errors.
Have in /home/e-smith/files/primary/html/ the file test2.html contents:




CGI Test Page


CGI Test Page








Click the button and get:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

The lines this error puts in the error.log are:

19 12:04:24 2000] [error] (2)No such file or directory: exec of /home/e-smith/files/primary/cgi-bin/Edit2.cgi failed
[Tue Dec 19 12:04:24 2000] [error] [client 10.0.0.157] Premature end of script headers: /home/e-smith/files/primary/cgi-bin/Edit2.cgi

I can't figure this out. Where could I be going wrong?
Thanks,
-Neil-

Charlie Brady

RE: 500 internal server error with cgi scripts
« Reply #1 on: December 19, 2000, 09:40:06 PM »
Neil Bryan wrote:

> I.ve updated to 4.0.1.
....
> Internal Server Error The server encountered an internal error
> or misconfiguration and was unable to complete your request.

Please read the "important note" in the release notes for the 4.0.1 update:

http://www.e-smith.org/article.php3&mode=threaded&order=0

Regards

Charlie

Neil Bryan

RE: 500 internal server error with cgi scripts
« Reply #2 on: December 19, 2000, 09:56:17 PM »
This is not an i-bay, it is the root web site of the server. And I have run the commands mentioned for the one i-bay I have installed. It did not work there either.
Do those commands need to be run for the httpd server root as well?
-Neil-

martin

RE: 500 internal server error with cgi scripts
« Reply #3 on: December 19, 2000, 10:11:17 PM »
try this:
login per telnet or direct on the server.
go to the cgi-bin directory.
type vi edit2.cgi
press the "esc" and then the ":" -key
type set fileformat=unix
press enter
press the "esc" and then the ":" -key
type wq!


If it works:
The cgi-scripts had to be in unix-fileformat.
If you edit it in Windows and ftp it to the cgi-dirctory, it is in windows format.
So you have to change the fileformat - like above.

Neil Bryan

RE: 500 internal server error with cgi scripts
« Reply #4 on: December 19, 2000, 11:04:31 PM »
Yes! You the Man! T'was the file format. I have ordered my editor to preserve file format. UltraEdit also has a conversion command for DOS to UNIX. I'll be using it.
This is an issue to be considered with Samba enabling Windows access to Web server files, cgi script files in particular. Good ole vi!
Help much appreciated.
-Neil-

Charlie Brady

RE: 500 internal server error with cgi scripts
« Reply #5 on: December 19, 2000, 11:25:05 PM »
Neil Bryan wrote:

> This is not an i-bay, it is the root web site of the server.

Sorry for not reading your post carefully enough. Fortunately you have had some better advice already! :-)

Regards

Charlie

Neil Bryan

RE: 500 internal server error with cgi scripts
« Reply #6 on: December 20, 2000, 12:01:29 AM »
I am very pleasantly surprised by the speed of responses on the E-Smith forums. My issue was addressed within an hour, and another headache is gone! My compliments and thanks to E-Smith staff and other helpful and articulate forum users. I have come to expect, with some derision, a long and useless wait for service whether posting to forums, telephoning (grrrrr.... to voice-mail-jail), or emailing for help at the majority of vendor sites.
Way to go and keep it up!
-Neil-