[Gambas-user] Apache config

T Lee Davidson t.lee.davidson at gmail.com
Tue Oct 11 19:00:47 CEST 2022

On 10/11/22 08:58, Marco Ancillotti wrote:
> Hi all,
> is there a guide on how to configure apache to serve gambas web form ?
> I have lighttpd that work but I need to setup an apache2 to serve my app.
> This is my config:
> <IfModule mod_alias.c>
>          <IfModule mod_cgi.c>
>                  Define ENABLE_USR_LIB_CGI_BIN
>          </IfModule>
>          <IfModule mod_cgid.c>
>                 Define ENABLE_USR_LIB_CGI_BIN
>          </IfModule>
>          <IfDefine ENABLE_USR_LIB_CGI_BIN>
>                  ScriptAlias /gbx/ /var/www/html/gbx/
>                  <Directory "/var/www/html/gbx">
>                          AllowOverride None
>                          Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>                          Require all granted
>                          AddHandler cgi-script .cgi .sh .pl .gambas
>                  </Directory>
>          </IfDefine>
> </IfModule>
> When I run gambas program I see a gbr3 process defunct and the web server log timeout:
>   AH01220: Timeout waiting for output from CGI script /var/www/html/gbx/tcadmin
>   Script timed out before returning headers: tcadmin
> Other cgi ( like perl ) work without problem.
> Thank's in advance,
> marco.

Lighttpd seems to be more forgiving, and more intelligent in some cases, than Apache2. I suspect there is something in your 
application that Apache does not like.

The Web form example created when you create a new ("New project...") Web form application runs fine on my system with both 
Lighttpd and Apache2. Perhaps you could start with that on Apache and then add in functionality from your application until you 
find the one that makes Apache choke.

Here is my ScriptAlias and CGI config from 'default-server.conf':
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.
<Directory "/srv/www/cgi-bin">
  AllowOverride None
  Options +ExecCGI -Includes
  <IfModule !mod_access_compat.c>
   Require all granted
  <IfModule mod_access_compat.c>
   Order allow,deny
   Allow from all

For some reason unknown to me, the only place I needed to add ".gambas" to the CGI script handler was in 'mod_userdir.conf'.

You didn't mention what Linux distro you're using. But, maybe the some of this info might be helpful:


More information about the User mailing list