Help - Search - Members - Calendar
Full Version: Apache2 & CGI-BIN Problem
Hydrogenaudio Forums > Misc. > Off-Topic
Sebastian Mares
Greetings!

I have some problems configuring my Apache2 installation to work with ActivePerl. After spending about one hour trying to figure out why I get a 404 when trying to execute a script, I realized that I forgotten to add a trailing slash to the ScriptAlias. Anyway, now everything seems to be in order with Mozilla, but Internet Explorer prompts me to save the Perl files, rather than execute them, although I have added the following line to the Apache2 configuration file:

"AddHandler cgi-script .cgi .pl"

Any ideas what is wrong?

Sebastian Mares
VLSI
Hi,

I have the following in my config:

CODE
ScriptAlias /cgi-bin/ "C:/site/cgi-bin/"

<Directory "C:/site/cgi-bin">
   AllowOverride None
   Options None
   Order allow,deny
   Allow from all
</Directory>


It works for me in Apache 2.0.49 with Mozilla and IE6.

Also, your Perl script will need to produce a Content-Type your instance of IE can render. AFAIK, IE will ask to save any MIME type it doesn't know.
Sebastian Mares
Well, that is funny. I have the same configuration (except that the folders are different) and the Perl script produces a content type:

CODE

#!C:/Server/Programs/HTTP/perl/bin/perl.exe
##
##  printenv -- demo CGI program which just prints its environment
##

print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
   $val = $ENV{$var};
   $val =~ s|\n|\\n|g;
   $val =~ s|"|\\"|g;
   print "${var}=\"${val}\"\n";
}


Edit: Changing to "text/html" solves the problem, but IE should be capabile of displaying plain text files, too, or am I wrong? Another interesting thing is that after IE loaded the page using "text/html" it can also load the page if I change the content type to "text/plain". I think this is more an Internet Explorer issue, rather than a misconfiguration of my server.
VLSI
Your right, it is an IE issue. The problem is that the resource ends in .cgi or .pl, not .txt. Maybe some IE settings could fix this, but you probably want your pages to load on default configurations.

Good luck.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.