FCGI Configuration
------------------

Apache supports two different FCGI implementations. One is the module mod_fcgid which only works as a single
threaded interface but is more suited to development because it only starts an FCGI server after the initial
request is issued.

The other mod_fastcgi is more suited to a production environment as it is a multi-threaded interface and all
FCGI servers are started when Apache itself starts and are restarted automatically if they exit (or crash).

Notes for using mod_fcgid with Apache 2.2
-----------------------------------------

1) Install the FCGI Apache module and enable it (using "a2enmod fcgid").

2) Make the following changes to "/etc/apache2/default-server.conf" (or "/etc/apache2/apache2.conf"):

sudo vi /etc/apache2/default-server.conf

...
<Directory "/srv/www/htdocs"> (or "/var/www")
...
    Options ExecCGI FollowSymLinks
    AddHandler fcgid-script .fcgi
...
    AllowOverride All
...
</Directory>
...
(need to add the following IfModule tags and settings after the above lines)
...
<IfModule fcgid_module>
   MaxProcessCount               10
   MaxRequestLen                 10485760
   IdleTimeOut                   3600
   IPCConnectTimeout             20
   IPCCommTimeout                300
   DefaultMaxClassProcessCount   1
   DefaultMinClassProcessCount   1
</IfModule>
...

Once the changes have been made restart the apache2 web service:

sudo systemctl restart apache2