Apache 2.4: mod_proxy_fcgi

With Apache 2.4, mod_proxy_fcgi is used instead of mod_fastcgi.

Note: Assume the Genero Application Server is installed in the following directory (FGLASDIR): /opt/gas. Make the appropriate substitution for the FGLASDIR when applying these examples to your own configuration.

Apache 2.4 does not officially support mod_fastcgi, use mod_proxy_fcgi instead. This module requires Genero Application Server 2.50 (or later). For more information on Apache modules, refer to the Apache documentation.

  1. Find the Apache configuration file (for example, httpd.conf). It is likely to be located in the /etc/apache2/ path.
  2. Ensure the modules mod_proxy and mod_proxy_fcgi are enabled. For example, these lines must appear in your Apache configuration.
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
  3. Add the following lines to the configuration file:
    Note: Starting with Apache 2.4.11, you can add the enablereuse=on option in the ProxyPass configuration line, in order to recycle connections to the fastcgi dispatcher.
    ...
    <IfModule mod_proxy_fcgi.c>
      #No PATH_INFO with mod_proxy_fcgi unless this is set
      SetEnvIf Request_URI . proxy-fcgi-pathinfo=1
    
      ProxyPass /gas/ fcgi://localhost:6394/ enablereuse=on
      Alias /gas /opt/gas/bin/fastcgidispatch 
    </IfModule>
    ... 
    In this excerpt:
    • localhost is where the fastcgidispatch is running
    • fastcgidispatch is listening on port 6394
    • /gas/ directory is just a virtual directory, no need to create one
    • The Alias directive specifies where documents are stored in the local file system
  4. Start fastcgidispatch in standalone mode with fastcgidispatch -s. If this dispatcher fails, it must be restarted manually.