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
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 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/

Then restart apache

cPanel Notes[edit]

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:


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

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