You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Wendy Moore <we...@yahoo.com> on 2003/11/30 16:48:24 UTC
[users@httpd] Perl, CGI and Apache
Hi,
I want to run a perl script as a cgi script.
I'm running: Apache/1.3.29 (Win32) mod_ssl/2.8.16 OpenSSL/0.9.7c PHP/4.3.3
(And installed ActivePerl 5.8)
I've changed the httpd.conf
ScriptAlias /cgi-bin/ "d:/WebDEV/Apache/cgi-bin/"
<Directory "d:/WebDEV/Apache/cgi-bin/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
AddHandler cgi-script .cgi .pl
When taking the URL: http://apollo/cgi-bin/printenv.pl , it will download a file printenv.pl
which contains the output of the perlscript. It works correctly if I change the extention from .pl to .cgi.
How can I configure Apache so I don't need to change the extention?
Regards,
---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
Re: [users@httpd] Perl, CGI and Apache
Posted by Joshua Slive <jo...@slive.ca>.
On Sun, 30 Nov 2003, Wendy Moore wrote:
> I've changed the httpd.conf
>
> ScriptAlias /cgi-bin/ "d:/WebDEV/Apache/cgi-bin/"
>
>
> <Directory "d:/WebDEV/Apache/cgi-bin/">
> AllowOverride None
> Options ExecCGI
> Order allow,deny
> Allow from all
> </Directory>
>
> AddHandler cgi-script .cgi .pl
>
>
> When taking the URL: http://apollo/cgi-bin/printenv.pl , it will
> download a file printenv.pl
>
> which contains the output of the perlscript. It works correctly if I
> change the extention from .pl to .cgi.
>
> How can I configure Apache so I don't need to change the extention?
First the answer to your question: This has nothing to do with apache. It
is MSIE that is violating the HTTP standard and deciding how to handle the
content based on extension rather than mime-type. See:
http://httpd.apache.org/docs/misc/FAQ.html#ie-ignores-mime
Second: You have a bunch of superfluous stuff. The ScriptAlias sets the
correct options and handler for you, so you don't need the "Options
ExecCGI" or the "AddHandler" directive.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org