Koozali.org: home of the SME Server

Execute cgi script problem

Mark

Execute cgi script problem
« on: November 02, 2003, 12:37:38 PM »
I searched the forums with not much luck.  Running 5.1.2,  Installed a program that requires running an "install.cgi" from within the primary cgi-bin directory.  When I run the file via  "http://mydomain.com/cgi-bin/install.cgi "  I get the following error...

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

Please contact the server administrator, admin@mydomain.com 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."

I check /etc/httpd/logs/error_log and see...

[error] (13) Permission denied: exec of /home/e-smith/files/primary/cgi-bin/install.cgi failed
[error] Premature end of script headers: /home/e-smith/primary/cgi-bin/install.cgi

I check permissions of "install.cgi" with ls -l and see...

-rwxr-xr-x 1 admin shared 2592 Nov 1 16:50 install.cgi

I check /ect/httpd/conf/httpd.conf and...
"AddHandler cgi-script .cgi" is uncommented.

Why doesn't this script execute?

TIA

Mark

Re: Execute cgi script problem
« Reply #1 on: November 02, 2003, 11:49:08 PM »
Should clarify...

I changed the pathe to perl to "/usr/bin/perl", now the error message I get is

Can't locate DBI.pm in @INC (@INC contains: $wanted_path /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at (eval 3) line 3.

Anyone know what this is about and how to fix?

TIA

Ray Mitchell

Re: Execute cgi script problem
« Reply #2 on: November 03, 2003, 06:40:05 AM »
Did you enable allow execute cgi in the ibay settings. ?

Regs
Ray

Mark

Re: Execute cgi script problem
« Reply #3 on: November 03, 2003, 06:11:06 PM »
The short answer is no.  However, I'm trying to execute cgi in the primary cgi-bin, not the ibays.  I have executed other cgi scripts sucessfully.  I think the problem has to do with the absence of file DBI.pm in /usr/lib/perl5/site_perl/5.6.0/i386-linux.

I checked my Red Hat 7.3 stock machine and DBI.pm is included, whereas in the SME 5.1.2 it is missing.  I am not sure how to add it.

Mark

Greg Zartman

Re: Execute cgi script problem
« Reply #4 on: November 03, 2003, 07:42:13 PM »
Here's a nice script to report which perl modules are installed.  You'll note from running this that DBI is not installed on SME.

To get DBI, simply install the DBI redhat RPM for the version of SME that you have.  I can't remember which verison of RH that SME 5.1.2 is based on...  I think RH 7.1.  When you determin that, do a search on Rawhide or google.

Greg Zartman


###Perl modules Script.
eval 'exec perl -w -S $0 ${1+"$@"}'
if 0;

use warnings;
use strict;
use ExtUtils::Installed;

# Find all the installed modules
print("Finding all installed Perl modules...\n");

my $installed = ExtUtils::Installed->new();
my $max_length = 0;

# Let's find the longest name
foreach my $module (grep(!/^Perl$/, $installed->modules()))
{
(length ($module) > $max_length) and $max_length = length ($module);
}

# A nice way to print the results
my $format = " %-".$max_length."s Version %s\n";

# We display all the modules along with their version
foreach my $module (grep(!/^Perl$/, $installed->modules()))
{
my $version = $installed->version($module) || "???";

printf($format, $module, $version);
}

Greg Zartman

Re: Execute cgi script problem
« Reply #5 on: November 03, 2003, 07:45:48 PM »
I take that back.  DBI is installed on SME 6:


[root@testbed root]# rpm -qa | grep DBI
perl-DBI-1.21-1
[root@testbed root]#

Greg Zartman