Configure FastCGI for Apache prior to 2.4
For Apache prior to 2.4, you configure FastCGI with the mod_fastcgi
module.
Configuration instructions provided in this page will probably work in the majority of situations, but sometimes they may require adaptation depending on the version of Apache you have. Therefore, we recommend that you refer to the Apache documentation (external link) if you need to know about specific configuration options. In production environments, the configuration of the Apache HTTP server should be carried out by a system administrator to avoid security issues.
Module mod_fastcgi
is the Apache module for FastCGI support for versions of
Apache prior to 2.4.
In this page, there are details for configuring FastCGI when Apache is on the same server as the GAS ( Configure mod_fastcgi to manage GAS process) and when on an external GAS (Configure mod_fastcgi for external GAS). For details about using GAS compression, go to Using mod_deflate for compression with mod_fastcgi.
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 support mod_fastcgi
. If you are using Apache 2.4, use
mod_proxy_fcgi
instead.
For more information on the Apache modules, refer to the Apache documentation.
mod_fastcgi installation
Install the software package for your system. For more information, see the FastCGI archive site.
Configure mod_fastcgi to manage GAS process
- Enable the load module directive for
mod_fastcgi
by removing the hash symbol (#) from the start of the line. Be aware that your configuration may be different to that shown in the example. - Add the lines to configure FastCGI server and set permissions for the GAS.
LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
<IfModule fastcgi_module>
FastCgiServer /opt/gas/bin/wrapper.fcgi -idle-timeout 300
-initial-env FGLASDIR=/opt/gas
Alias /gas /opt/gas/bin/wrapper.fcgi
</IfModule>
# set permissions for /gas alias
<Location /gas>
Order Deny,Allow
Deny from all
Allow from mycompany.com
</Location>
Where: - wrapper.fcgi is a script delivered with GAS installation that simplifies
FastCGI configuration. You can amend this script to add options for
fastcgidispatch, like
-f
to specify a custom configuration file. - /gas directory is just a virtual directory, no need to create one.
- /gas alias permission is set to deny all access to GAS except for clients from mycompany.com. You can modify the alias configuration to your needs. For more details on FastCgiServer directive, see mod_fastcgi Apache 2 module.
- "
-idle-timeout
" must be greater thanREQUEST_RESULT
timeout in GAS configuration. [By default:<REQUEST_RESULT>
: 45 seconds, mod_fastcgi "-idle-timeout
" : 300 seconds]
Configure mod_fastcgi for external GAS
mod_fastcgi
in your
Apache configuration for this. In your Apache configuration file (for example,
httpd.conf):- Check that the load module directive for
mod_fastcgi
is enabled. The hash symbol (#) must be removed from the start of the line. Be aware that your configuration may be different to that shown in the example. - Add the lines to configure FastCGI on the external GAS.
LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
<IfModule fastcgi_module>
FastCgiExternalServer /gas -idle-timeout 300 -host <gas-server-ip>:<gas-server-port>
Alias /gas /gas
</IfModule>
Where:- "
-idle-timeout
" must be greater thanREQUEST_RESULT
timeout in GAS configuration. [By default:REQUEST_RESULT
: 45 seconds, mod_fastcgi-idle-timeout
: 300 seconds] - /gas directory is just a virtual directory, no need to create one.
- gas-server-ip is the address of the external server where the GAS is running.
- gas-server-port is the port where
fastcgidispatch
is listening.
For more information see the Apache: mod_fastcgi topic in the Genero Application Server User Guide version 2.30
Using mod_deflate for compression with mod_fastcgi
With an Apache web
server, compression is typically enabled through the mod_deflate module;
however, as the GAS uses it own compression mechanism, we recommend that you disable
mod_deflate
. For more information on disabling mod_deflate
, please
refer to the fastcgi documentation or contact your system administrator.