[clug-talk] Apache web server with cgi / perl scipts

Darcy Brodie darcy at canasc.ca
Tue Dec 29 10:34:44 PST 2009


Dean Mah wrote:
>
> On 2009-12-28, at 10:06 PM, Darcy Brodie <darcy at canasc.ca> wrote:
>
>> From the script for the password program, when I run it from the 
>> browser, I get
>>    (2)No such file or directory: exec of 
>> '/var/www/cgi-bin/batchsetup.cgi' failed
>>    Premature end of script headers: batchsetup.cgi
>
> It sounds like something is in the wrong place. Try running perl -c 
> batchsetup.cgi from the command line. Also make sure that the path to 
> perl in batchsetup.cgi is correct. The path to perl should be the very 
> first line, beware of blank lines and any space preceding #. Check 
> spelling of script name and pathname. Make sure Apache is executing 
> .pl and .cgi scripts. Convert the script to Unix if it was created or 
> transferred from a DOS box.

Dean

perl -c batchsetup.cgi from the command line results in  "syntax ok"
The perl path in batchsetup is #!/usr/bin/perl , which is the same as my 
test scripts, and it is the very first line.

As far as this file being created or copied from a dos machine, good 
question.  I received it as a zip file, and I unzipped it directly into 
the target directory


Now get this.  I have tried on several occasions (generally because I 
thought I may have messed up the program trying to get it to run) I have 
re-downloaded the program, and unzipped it in the destination 
directory.  This has never resulted in any progress.  However.  This 
morning, I did it again (re-download and unzip), ran the program and it 
worked.  I have no idea what changed this time, but it is now working.

Thanks to everyone who assisted with suggestions.  I hope to be at the 
meeting next week.

Darcy



More information about the clug-talk mailing list