You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by azurIt <az...@pobox.sk> on 2013/09/03 22:05:33 UTC

[users@httpd] cgi interpreters

Hi,

is it, somehow, possible to set CGI script interpreters in linux? For example:
- interpterer for .py is /usr/bin/python
- .sh is /bin/bash
etc.

It's impossible, in our environment, to run scripts directly because partition is mounted with noexec (for security reasons). But we are allowing to run system wide executables like python, perl etc. Any hints? Thnks.

azur

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi interpreters

Posted by azurIt <az...@pobox.sk>.
>On Tue, Sep 3, 2013 at 4:05 PM, azurIt <az...@pobox.sk> wrote:
>> Hi,
>>
>> is it, somehow, possible to set CGI script interpreters in linux? For example:
>> - interpterer for .py is /usr/bin/python
>> - .sh is /bin/bash
>> etc.
>
>Check out the Action directive.  You'll probably need to write a small wrapper.


Thank you Eric, this is my working solution:

ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/"

<Directory ...>
AllowOverride all
Options +ExecCGI
AddHandler python-script .py .pyc
Action python-script /cgi-bin/python.cgi
</Directory>




Content of /usr/lib/cgi-bin/python.cgi:

#!/bin/sh
/usr/bin/env python $PATH_TRANSLATED


azur

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi interpreters

Posted by Eric Covener <co...@gmail.com>.
On Tue, Sep 3, 2013 at 4:05 PM, azurIt <az...@pobox.sk> wrote:
> Hi,
>
> is it, somehow, possible to set CGI script interpreters in linux? For example:
> - interpterer for .py is /usr/bin/python
> - .sh is /bin/bash
> etc.

Check out the Action directive.  You'll probably need to write a small wrapper.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org