i run Apache web server on windows in order to work on some Perl CGI scripts. in production these scripts run on a linux box, and in the source code repository they all have shebangs like: #!/usr/bin/perl
, but on my windows machine the shebangs would be #!c:\perl\bin\perl.exe
, so i have a conflict with the source code base.
enter the Apache ScriptInterpreterSource directive.
i've been trying to make it work, based on what i can google. but so far no luck. i have:
added these things to the appropriate directive
AllowOverride None
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
Allow from all
ScriptInterpreterSource Registry-Strict
added: AddHandler cgi-script .cgi
edited my registry and added a new String to
HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command=C:\Perl\bin\perl.exe
now, i know that CGIs work on this server as long as they have the right shebang.
but when i try to access a CGI without a shebang the apache log spits out:
No Exec CGI Verb found for files of type '.cgi'
any thoughts, insights, or even wild-ass guesses would be appreciated.
thanks.
It sounds like the ScriptInterpreterSource line is being ignored. If it's set to Registry or Registry-Strict, it should ignore the shebang lines and use the registry only.
Also, the Apache 2.2 docs have a slightly different location for the registry key:
HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command\(Default) => C:\Perl\bin\perl.exe -wT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With