JayT 0 Newbie Poster

Hi,

I've been reading through some tutorials on creating a basic web upload script with perl and cgi. The problem is that my server keeps throwing an Internal Server Error 500 without giving any feedback. I am hoping that someone has run into a similar problem or there is an obvious problem with my script. Here is the form script on the html document (/var/www/apache2-default/projects/music/music.html):

<FORM ACTION="upload.cgi" METHOD="POST" ENCTYPE="multipart/form-data">
Song to Upload: <INPUT TYPE="file" NAME="song">
<br>
<INPUT TYPE="submit" NAME="Submit" VALUE="Submit Form">
</FORM>

My httpd.conf for Apache2:

<Directory /var/www/apache2-default/projects/music/>
Options FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
</Directory>

And my actual upload.cgi file:

#!/usr/bin/perl -w

use CGI;
$upload_dir = "/apache2-default/projects/music/upload";

$query = new CGI;

$filename = $query->param("song");
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("song");

open(UPLOADFILE, ">$upload_dir/$filename") or die "Can't open '$upload_dir/$filename': $!";
binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;

All folders and files have been chmoded to 755 for all user execution. Even so, it seems like the httpd.conf points to the correct directory to allow cgi execution, but there has to be something wrong with the upload.cgi script.

JayT 0 Newbie Poster

The original problem was after restart. When I restarted my laptop, the computer brought up a PXE boot screen. It prompty failed to load and then displayed "No Operating System Detected". Since the hard drive was old, I figured I would upgrade the drive and backup data since I could mount the drive with a LiveCD. I replaced the hard drive and reinstalled Ubuntu without a hitch. Then last night, it gave me the same error. I tried editing menu.lst by commenting out everything except recovery mode, however now it simply brings a blinking underscore on reboot.

I had been trying to setup an emulator prior to the second hard drive failure. The settings I had played around with dealt with IRQ's, so that may have something to do with it (However, I turned them off when I booted with the LiveCD and it still brought the same error). Is there anything I can do besides reformat?