Koozali.org: home of the SME Server

cgi-bin problems

Philip

cgi-bin problems
« on: October 10, 2001, 07:58:04 PM »
Hi.

I am having difficulty in getting some scripts to work in the cgi-bin of my ibays. I have set the ibays up to execute dynamic content such as php and the cgi-bin but the browser returns Internal Server Error 500 messages when I access the script.

The script is as follows (nothing too complex) -

#!/usr/local/bin/perl

#  Alert! The web server is *NOT* processing the script if you can read this line.

print "Content-type: text/html\n\n";
print "Hello world from PERL $]\n";

print "

.cgi scripts  are mapped to Perl.";

Can anyone shed any light on where I am going wrong?...


Luke Drumm

Re: cgi-bin problems
« Reply #1 on: October 11, 2001, 05:36:09 AM »
Firstly, regarding PHP scripts, they actually need to go into the HTML folder to work correctly.

As for the perl stuff, my guesses are as follows:

1 - permissions. You may need to check that the scripts have the executable permissions set. (eg. When you do an 'ls -la' in the folder, it shows something like rwxr-xr-x).

2 - buffers. Apache (along with most other wbe servers) are pretty picky about how long it takes for CGI stuff to return something. I'd suggest using the CGI module that comes standard with most Perl installations. You can find out more about this beast either by running 'Perldoc -U CGI' on the server or visiting sites such as perlmonks.org.

In either case, a look at the apache error logs is probably the best place to start.
You can access the logs from the admin web pages (only in SME v5+) or from the command line as follows:
tail /var/httpd/logs/error_log

Regards,
Luke