Configure FastCGI for Apache 2.4
For Apache 2.4, you configure FastCGI to connect to the GAS using the
mod_proxy_fcgi
module. If authorization is used, configure a rewrite
rule.
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.
If you are using authorization headers, go to Create a configuration for the GAS with a rewrite-rule for authorization headers.
Module mod_proxy_fcgi
is the FastCGI
Apache module to use for Apache 2.4. This module requires GAS 2.50 or later. Apache 2.4 does not
officially support the mod_fastcgi
module used in earlier Apache versions. For more
information on Apache modules, refer to the Apache documentation (external link).
Steps to configure Apache to connect to a GAS
Create a configuration for the GAS with a rewrite-rule for authorization headers
RewriteRule
because Apache will discard the authorization header if
it is not a base64-encoded user/password combination. For more information on rewrite rules, refer
to the Apache 2.4 documentation (external link). As Apache configuration may vary from version to version, you may need to select one of these methods to pass the authorization header:
- You can configure a rewrite rule as shown (this is the method used in this
task):
# Requires mod_rewrite module RewriteEngine on RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
- Or you can configure a rewrite rule, by defining a condition under which rewriting takes place
using
RewriteCond
:# Requires mod_rewrite module RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
- Or, if you have
SetEnv
module enabled, you can useSetEnvIf
:# Requires SetEnv module SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
Steps to configure Apache to connect to a GAS