I haven't used Apache i've used lighttpd.gbWilly wrote: ↑Saturday 16th July 2022 1:13pmHi Bruce, could you explain why it didn't work at first and how you made it work.
Never mind I figured it outBruceSteers wrote: ↑
Wednesday 13th July 2022 12:35pm
Can anyone tell me why if i make a link and point it to my gambas cgi app when clicking it all it does is download the cgi not run it?
I now have gb.web things working
I'm planning on running a Gambas based webserver myself somewhere in the near future.
I know it is very hard to find good documentation on how to set it up and get it working as I have been looking into this many times before.
I'll be running the Gambas based website on an Apache server as I have the most experience with running these.
Any help, links to documentation or whatever helped you get it running is much appreciated.
It wasn't working for me because i had not installed the correct lighttpd modules (i think it was fastcgi and fastcgi-php was needed)
for lighttpd i now just use a .gambas file (do not rename to .gambas.cgi) as in the above config .cgi is linked to perl not gbr3T Lee Davidson wrote: > If not, are there any examples of how to correctly run the cgi's (read the wiki how-to, still not getting it)
This is not an example, but the configuration is relatively straightforward. I use OpenSUSE, and so the file names, locations,
and configurations may be different for other distros.
For Apache2, you just need to ensure that there is a ScriptAlias defined and configured. That should be done in (/etc/apache2/)
'default-server.conf' and looks like:
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
Options +ExecCGI -Includes
Require all granted
Allow from all
Then simply place your app in this CGI directory. This works because a CGI app runs as a script. If you use the `head` command
on a Gambas script executable file (.gambas) you will see the first line is: "#! /usr/bin/env gbr3"
Apache2 is stupid. It will try to execute virtually *every* type of file contained within the cgi-bin directory tree.
Lighttpd is a bit more intelligent. For that server, you will need to edit (/etc/lighttpd/) 'cgi.conf' found in the 'conf.d'
directory. After editing my local installation to run Gambas CGI scripts, it looks like:
## Plain old CGI handling
## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".rb" => "/usr/bin/ruby",
".erb" => "/usr/bin/eruby",
".py" => "/usr/bin/python",
".gambas" => "/usr/bin/gbr3")