Click to See Complete Forum and Search --> : 500 Internal Server Error


AWebDesign
03-23-2001, 12:58 AM
Hi guys,

I've been trying to get some cgi scripts going on my server, and I keep getting 500 Internal Server Error, and it's pissing me off. here is what is in my httpd.conf
<Directory "/usr/local/apache/cgi-bin">
AllowOverride Options
Options +ExecCGI
AddHandler cgi-script cgi pl
Order allow,deny
Allow from all
</Directory>

Why isn't this working?
I try to call
myip/cgi-bin/test.cgi
and i get the error, it happens with every script i try in that dir
Thanks,
Aaron

freebsd
03-23-2001, 01:25 AM
<Directory "/usr/local/apache/cgi-bin">
AllowOverride Options
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Order allow,deny
Allow from all
</Directory>

AWebDesign
03-23-2001, 09:00 AM
Tried it, still doesn't work, in my
error_log i'm getting this:
[error] (2)No such file or directory: exec of /usr/local/apache/cgi-bin/1.cgi failed
[error] Premature end of script headers: /use/local/apache/cgi-bin/1.cgi

Both of those are marked with the same time, so i'm guessing they happened @ the same time.
Help?

Aaron


Help?

Aaron

[ 23 March 2001: Message edited by: AWebDesign ]

Energon
03-23-2001, 09:36 AM
post the script...

Infested Flar
03-23-2001, 11:29 AM
your scripts should be writable by the user that your webserver is running© say, if Apache is running under nobody, then *©cgi's ownership should be changed to nobody©

# chown nobody file©cgi


just a suggestion in case©©

-flar-

freebsd
03-23-2001, 12:50 PM
>> [error] (2)

Find out where perl is because the 1st line of your script is not #!/usr/bin/perl or the actual path.

The most common mistake is that your script was uploaded in binary format causing the 1st line to become #!/usr/bin/perl^M

You don't need to post your script here nor do you need to set reset any permission for it just because that's what error 2 means.

[ 23 March 2001: Message edited by: freebsd ]

AWebDesign
03-23-2001, 05:06 PM
I type
which perl

/usr/bin/perl

1st line of my script is:
#!/usr/bin/perl

Still doing it.

Thanks for help guys, keep it comin

Aaron

Fireman-x
03-24-2001, 04:49 AM
Your 1.cgi is trying to access a file that it can't find, or however you are calling 1.cgi isn't working, because it's not finding 1.cgi.

I'd bet it's the first thing though, because the 'premature end of script headers' appears when a cgi errors out and doesn't have any error handling code in it.

johnwebb
03-24-2001, 12:26 PM
Unless your running suexec the owner of the file should not matter. Check that the file permissions are set correctly. It must be executable to run.

chmod 755 /path/to/file_name