Re: Apache Perl/CGI Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2009-01-09 at 18:08 +0100, Günther Kastenfrosch wrote:
> Hi Michael, thanks for your response.
> 
> 2009/1/9 Michael Ludwig <mlu@xxxxxxxxxxxxx>:
> > What about setting up various Apache instances for your developers?
> 
> I can't see that this would help. I cannot even tell the apache server
> root config to run .pl scripts with a given interpreter. I can only
> chose between shebang and win registry to select perl executable from.
> 
> Perhaps I'm really thinking too complicated? But on our IIS (to be
> shut down) it's part of the server setting to select the runnable for
> cgi-scripts. This was very useful, but there's no problem to find a
> completly different solution that is practible without running apache
> on all of the developer's pcs. (even this is not enough, because
> everyone needs access to different perl.exes).
> 
> Günther
> 
> > PS: Wunderschöner Nachname!
> Danke. Ich hab ein bisschen respekt davor dumme fragen unter realnamen
> in archivierten mailinglisten zu stellen ;)
> 

Hello Gunther

You probably have found a solution to this already, but I'm catching up
on my old emails, and offer this to the list..

This may not be an acceptable solution, but how about setting the
interpreter to being some other command, which would read in the correct
interpreter to run from the environment, and then exec the appropriate
one. You could then use the SetEnv directive to control which
interpreter is used on each vhost.

Something like this ought to do the trick:

#include <stdlib.h>
#include <unistd.h>

int main(int argc, char* argv[], char* envp[])
{
    char* default_perl = "/usr/bin/perl";
    char* perl = NULL;
    if (!(perl = getenv("PERL_INTERPRETER")))
        perl = default_perl;
    argv[0] = perl;
    return execve(perl, argv, envp);
}

Unfortunately, I don't know windows, so you would need someone to
convert that into a windows binary, but that would do the trick (I'm
assuming that this is for development, I wouldn't do this in
production!)

Cheers

Tom


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux