It seemed "SetHandler" in the mod_perl section overwrote the settings for
cgi-script. Adding the following to the directory stanza fixed the problem:
<FilesMatch .*>
SetHandler cgi-script
</FilesMatch>
.
Regards,
Jie
* Jie Gao <[email protected]> wrote:
> Date: Fri, 9 Jun 2017 20:35:43 +1000
> From: Jie Gao <[email protected]>
> To: [email protected]
> Subject: mod_perl and cgi-script handler
> User-Agent: Mutt/1.5.24 (2015-08-30)
>
> Hi All
>
> I have run into a problem with CGI under mod_perl, and I can't get my head
> around it.
>
> I wanted to put a "cgi-bin" directory under my authentication/authorisation
> handlers, but while authen/authz works fine (debug showing access granted),
> the directory is in the end not handled by "cgi-script", the default cgid
> content handler, and the text of the cgi script gets displayed instead.
>
> My configuration is like the following:
>
> #------------------------------------------------------------
>
> PerlAddAuthzProvider my_User W::W::Authnz->authz
>
> <VirtualHost _default_:443>
> ...
> ScriptAlias /cgi-bin/ "/var/www/my-server-name/cgi-bin/"
>
> <Directory /var/www/my-server-name/cgi-bin>
> AllowOverride None
>
> # PerlOptions +SetupEnv
> # Options +ExecCGI
> # SetHandler modperl
> # PerlAuthenHandler W::W::Authnz->authen
> # AuthType mytype
> # AuthName 'myname'
> # <RequireAll>
> # Require my_User mylogin
> # Require ip 10.65.
> # </RequireAll>
> </Directory>
>
> </VirtualHost>
>
> #------------------------------------------------------------
>
> If I comment out, as above, all the mod_perl configurations, and then add
> "Require all granted" to the directory stanza, the cgi scripts will run
> normally.
>
> Any tips/pointers as to where else I should look would be much appreciated.
>
> Regards,
>
>
>
> Jie
>