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, check your Apache configuration file for the load module directives for these modules; bearing in mind that your configuration may be different. Make sure the hash symbol (#) is removed from the start of the line.
    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:
    • To ensure application URLs with spaces are decoded correctly, proxy-fcgi-pathinfo must be set to unescape. There is no PATH_INFO with mod_proxy_fcgi unless this is set.
    • You can add the enablereuse=on option in the ProxyPass configuration line, in order to recycle connections to the fastcgi dispatcher.
    • To avoid timeout issues, set the ProxyPass timeout greater than the REQUEST_RESULT GAS configuration. If, for instance, REQUEST_RESULT is set to 60 seconds (default setting), you need to ensure you set the ProxyPass timeout higher at 100 seconds.
    ...
    <IfModule proxy_fcgi_module>
    
      # Unescapes the path component of the request URL 
      SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape
    
      # Maps the fastcgi server to the GAS URL space
      ProxyPass /gas/ fcgi://localhost:6394/ enablereuse=on timeout=100
         
    
    </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.
  4. Start fastcgidispatch in standalone mode with fastcgidispatch -s. If this dispatcher fails, it must be restarted manually.