Page 1 of 1

apache, cgi and perl

PostPosted: Sat Oct 20, 2001 12:41 am
by g3t
This is kinda off-topic but.. I see you have ultimatebb runnin..

I have web sharing enabled on 10.1, and when I go to exec a .pl or .cgi I get this error...

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] 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.

------------------------------------------------------------------------
Apache/1.3.20 Server at 127.0.0.1 Port 80

I read the apache help docs and set the the files are all chmod'd 755...

Here's the error in the apache error_log:

[Fri Oct 19 16:27:21 2001] [error] [client 64.241.221.45] Premature end of script headers: /Library/WebServer/Documents/cgi-bin/hello.pl
[Fri Oct 19 16:27:34 2001] [error] (2)No such file or directory: exec of /Library/WebServer/Documents/cgi-bin/hello.cgi failed
[Fri Oct 19 16:27:34 2001] [error] [client 64.241.221.45] Premature end of script headers: /Library/WebServer/Documents/cgi-bin/hello.cgi

I do not know what to do next..... ?

Re: apache, cgi and perl

PostPosted: Mon Oct 22, 2001 3:10 pm
by orange1
first thing i would check would be if you have a one line file with a buttload of ^M characters in it.
if so, delete them and replace with return carriages.

....

at least i think this effects osx. it was keeping me from compiling cpp files. if you have a nice text editor [mmmm, bbedit], you can set it to save files with unix endlines, instead of mac ones.

Re: apache, cgi and perl

PostPosted: Thu Oct 25, 2001 3:33 am
by ziwdam
Originally posted by willy wonka:
first thing i would check would be if you have a one line file with a buttload of ^M characters in it.
if so, delete them and replace with return carriages.


You can also do this in Terminal.app:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre> tr '\r' '\n' < file > file.out </pre>[/quote]

That will convert file from Mac line endings to UN*X line endings, and save the output into file.out.

Re: apache, cgi and perl

PostPosted: Sun Oct 26, 2003 12:42 am
by Devin
The wrong line endings will definitely make a difference.

What you've given isn't too much to go on, but here are some other things to check --

look in the apache error_log ([usr]/local/apache/logs/error_log) for useful hints

run the script from the command line and look for error messages.

-- devin