Home
TeamSite
Internal Server Error
System
Hi All,
I have written code for delete files dropdown script but now when I added the custom menu item and called the cgi script. I get a Internal server error. y??
the only change I made was the one in iw.cfg in etc directory and placed the cgi file in iw-bin directory.
Please answer
Thanks
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, 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.
--------------------------------------------------------------------------------
Apache/1.3.26 Server at mtc-iw-dev Port 80
Find more posts tagged with
Comments
Migrateduser
Maybe if you attached/posted your code, it might help people to help you.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
The other thing that might be helpful is to look at the iw-webd error log since there may be more verbose error output from the cgi there.
Migrateduser
Hi Smitty,
I added a custom menu item to file menu and invoked "deletefiles.cgi" and the script is attached here. please guide m if u can
Migrateduser
Hi Smitty,
I added a custom menu item to file menu and invoked "deletefiles.cgi" and the script is attached here. please guide m if u can.
#!opt/iw-home/iw-perl/bin/iwperl
#
# Perform Custom Delete Operation:
#Written by Alfred Rudrapati on 12/06/02
#
#
# Use these modules
use CGI qw(:standard);
use TeamSite::Config;
$| = 1;
# autoflush STDOUT
# Initial Config
$page = new CGI;
my $iwhome = TeamSite::Config::iwgethome();
# Page Parameters
my $user_name = $page->param('user_name');
###Get the names of files selected
# Create Page
print header;
print start_html(-title=>'TeamSite Custom Delete Operation',);
print qq(<BODY bgcolor="#C0C0C0">\n);
print qq(<FONT FACE="courier">\n);
print qq(<table border="0" width="100%" cellspacing="0" cellpadding="0">\n);
print qq(<tr>\n);
print qq(<td align="right"><strong><img src="/iw-icons/tslogosmall.gif" width="85" height="34" alt="tslogosmall.gif (2285 bytes)"></strong></td>\n);
print qq(</tr>\n);
print qq(</table>\n);
print qq(<CENTER>\n);
print qq(<h3><strong>TeamSite Custom Delete</strong></h3>\n);
print qq( );
print qq(</CENTER>\n);
print qq(<br>\n);
#DEBUG
#print $page->dump();
print qq(<CENTER>\n);
print_commands();
print qq(</CENTER>\n);
# BUTTONS
print qq(<p>\n);
print qq(<CENTER>\n);
print $page->button(-name=>'close',
-value=>'Close',
-onClick=>'self.close();',
);
print qq(</CENTER>\n);
print $page->end_html;
###############################################
#
# Subroutines
#
###############################################
sub print_commands {
# print qq(<TABLE><tr><td>);
print "<FORM name=ADMIN action=/iw-bin/Cusdelete.cgi method=post>\n";
# print qq(
@names
are the names of param);
if ($page->param('ts_command')) {
# Run the command
print qq(</td></tr></TABLE>\n);
} else {
print qq(<TABLE border=4>\n);
#### Get the file names selected
my $count = 0;
foreach $name ($page->param)
{
if ($name =~ /name_/)
{
$file_names[$count]=$page->param($name);
$count++;
}
}
##Get the vpath
my $vpath = $page->param('vpath');
###Do the comaprison with STAGING using iwcmp
$s_path = $vpath ;
$s_path =~ s/(.*)\/WORKAREA(.*)/$1\/STAGING/;
# print qq("$s_path i the path");
@result
= `$iwhome/bin/iwcmp $vpath $s_path 2>&1`;
print qq(<tr>);
###counters for table creation
$cmp_ct= 0;
$file_ct=0;
$last_file = $#file_names+1;
print "$last_cmp and $last_file";
foreach $cmp_list (
@result)
{
chomp($cmp_list);
if ($cmp_list=~ /f\+/)
{
$cmp_list =~ s/f\+\s*\-//g;
$cmp_list=~ s|^\s*||;
$cmp_list=~ s|\s*$||;
###has to see if the file is selected
foreach my $temp(
@file_names)
{
$temp=~ s|^\s*||;
$temp=~ s|\s*$||;
if ($temp eq $cmp_list)
{
print qq(<td>);
print qq( $temp);
print qq(<br>);
print qq(</td>);
$deletefile .=$temp\n;
}
else
{
print qq(<td>);
print qq($temp);
print qq(<br>);
print qq(</td>);
$workflowfile .=$temp\n;
}
}
} #if ($cmp_list=~ /f\+/)
} #foreach $cmp_list (
@result)
print qq(</tr>);
print qq(</TABLE>);
# HIDDEN USERNAME
print $page->hidden(-name=>'user_name',
-value=>$page->param('user_name'),
);
print qq(<p>\n);
print $page->submit(-name=>'RUN_COMMAND',
-value=>'Run Command',
);
print qq(</FORM>\n);
}
}
__END__
iwovGraduate
Few things to check:
1. What is the permission on the file ? It should have the execute bit on.
2. Can you run the script from command line ? It really won't help you test the functionality but atleast verify the syntax. You can run iwperl -c <filename> to check the syntax
Hope that helps
Migrateduser
Thanks a lot IWOV ...I had errors in the script...
Migrateduser
Hi
I cleared the errors
and iwperl -c <filename> now says syntax ok
I restarted the server and it again says the same error
what can be the problem?
Thanks in advance
Migrateduser
I checked the iwui error log
its says:
/opt/iw-home/httpd/iw-bin/deletefiles.cgi: not found
[Mon Dec 9 14:53:34 2002] [error] [client 10.159.44.115] Premature end of script headers: /opt/iw-home/httpd/iw-bin/iw_cgi_wrapper.cgi
Migrateduser
Well for starters, make sure your deletefiles.cgi is in the .../iw-home/httpd/iw-bin directory. All cgitask scripts are expected to be there - it even says so in the documentation.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
iwovGraduate
I notice the first line:
#!opt/iw-home/iw-perl/bin/iwperl..
Shouldn't this be
#!/opt/iw-home/iw-perl/bin/iwperl
?
Migrateduser
Thanks for ur help Iwov...U did help me a lot to get this to work
Migrateduser
ok...I cleared the errors and when my CGI loads its takes a real long time to load show the files selected...can anyone see y??
Thanks
Migrateduser
You appear to be running "iwcmp" - depending on the size of your areas, that can take a while to run.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Adam Stoller
From your earlier posting of the code (attached files are generally nicer than in-lining):
#!opt/iw-home/iw-perl/bin/iwperl
I believe you need a
/
between
#!
and
opt
- the command it cannot find is probably the Perl interpreter.
iwperl -w -c
won't detect this for you because in that case you are supplying the interpreter yourself and it doesn't worry about that first line.
Try fixing that and see if it resolves your problem
--fish
(Interwoven Senior Technical Consultant)