Mod fastcgi Install on Apache 2 / cPanel

From Leo's Notes
Last edited on 1 September 2019, at 06:21.

To install mod_fastcgi on your Apache2 (or cPanel configured with Apache2) server under CentOS/ScientificLinux/RHEL, you will need to compile it manually:

yum install httpd-devel
wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
tar -xzf mod_fastcgi*.tar.gz
cd mod_fastcgi*
mv Makefile.AP2 Makefile

Depending on where you have apache installed, you will need to define the top_dir variable. If your location is not /usr/local/apache2, you will need to do something like this:

make top_dir=/usr/local/apache
make top_dir=/usr/local/apache install

The module mod_fastcgi.so should now be in /usr/local/apache/modules/. We will now need to load the module.

vi /usr/local/apache/conf/httpd.conf

Add the following line:

LoadModule fastcgi_module modules/mod_fastcgi.so

Then restart apache

cPanel Notes

On cPanel, you will need to make sure that your changes to httpd.conf is persistent. To do so, run the following immediately after changing httpd.conf:

/usr/local/cpanel/bin/apache_conf_distiller --update

To verify that your changes are persistent, rebuild the configuration file:

 /usr/local/cpanel/bin/build_apache_conf

Then view the file again and see if your changes survived:

vi /usr/local/apache/conf/httpd.conf