[Gambas-user] Using Gambas for Apache cgi

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Sep 18 11:17:36 CEST 2012



Am 17.09.2012 21:46, schrieb Benoît Minisini:
> Le 17/09/2012 21:41, Demosthenes Koptsis a écrit :
>> Στις 17/9/2012 20:52, ο/η Tobias Boege έγραψε:
>>> On Mon, 17 Sep 2012, Rolf-Werner Eilert wrote:
>>>> Hi everyone,
>>>>
>>>> Long time ago I set up a Gambas application in my internal server for
>>>> cgi. I do remember there was some tweaking of Apache confs to tell it to
>>>> accept .gambas and .gbs as a cgi program, but I don't remember what it
>>>> was. Now I have tried to install this on another server, but of course
>>>> it wasn't as simple as just copying the binaries into cgi-bin.
>>>>
>>>> Can one of you guys point me to it? I already searched my apache config
>>>> files, but I didn't find where I have changed something.
>>>>
>>>> Thanks for your help.
>>>>
>>>> Rolf
>>>>
>>> Hi Rolf,
>>>
>>> my answer is as always: Hans (you know him?) already did this and wrote a
>>> paper (in german). I don't mind (and he doesn't mind me) sending it along
>>> with everything else he felt to put in that tarball back then (Gambas2
>>> times). Since I last sent it to someone I actually tested it out and it
>>> indeed worked on our school server ;-)
>>>
>>> Apache configuration is not much of that paper, I hope you find it
>>> useful; any credit to Hans.
>>>
>>> Unfortunately, the tarball (even only the PDF xz-compressed) appears to
>>> be>512 KiB (must have been the reason I never really wanted to send it to
>>> the list) and so I'll send it to you via private mail.
>>>
>>> Benoit, may I finally send the whole archive to the list (read: Are you
>>> inclined to approve that ~1.5 MiB archive?)
>>>
>>> Regards,
>>> Tobi
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>> Hi there,
>>
>> see the main server how it configs a cgi-bin directory.
>> in mine for www is
>>
>> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>> <Directory "/usr/lib/cgi-bin">
>> AllowOverride None
>> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>> Order allow,deny
>> Allow from all
>> </Directory>
>>
>> a similar config must be in your virtual host for its cgi-bin directory
>>
>> For more Apache configs see the official Apache docs.
>>
>> After that you have to create a script in an text editor with this line
>>
>> #!/usr/local/bin/gbs3
>>
>> or wherever gbs3 is located at your system
>>
>> this binary can run gambas scripts from console.
>>
>> i used it to write a gambas console script as cgi but Benoit suggests to
>> use instead a binary gambas file but i cant figure out how to run a
>> test.gambas file as cgi.
>>
>
> Hu??? If you can run any script (file beginning with "#!") as CGI
> script, then you run any gambas executable, that are script too. The
> only requirement is that "gbr3" and "gbx3" directory *must be in the
> PATH environmental variable*. Because Gambas executable start with "#!
> /usr/bin/env gbr3".
>
> Regards,
>

This is right, the script runs when I start it in the terminal and 
prints the HTML code for the start page into the terminal. So far Gambas 
is fine.

But Apache has some problem with it. I configured the cgi-bin as above 
(actually not me, but it's the default). Apache looks for it and 
seemingly it DOES find it but it complaints with a 500 Internal Error 
page and in /var/log/apache2/suexec.log we can read something about 
gid/uid mismatch.

Any idea where it might be stuck?

Regards
Rolf




More information about the User mailing list