1. Install httpd-itk

Command: yum install httpd-itk

Note: Requires EPEL repo

2. Download and install mod_fastcgi

Command: rpm -ivh mod_fastcgi-2.4.6-2.el6.cosh.x86_64.rpm

Get the RPM: http://rpm.centoshelp.org/el6/mod_fastcgi/

3. Edit /etc/sysconfig/httpd

Command: vi  /etc/sysconfig/httpd

#HTTPD=/usr/sbin/httpd.worker
HTTPD=/usr/sbin/httpd.itk

4. Edit /etc/php.ini

Command: vi /etc/php.ini

Find and uncomment the following 2 directives:
cgi.force_redirect = 1
cgi.fix_pathinfo = 1

5. Disable DSO (mod_php)

Command: mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.disable

6. Create /var/www/cgi-bin/php.fcgi

Command: vi  /var/www/cgi-bin/php.fcgi

Add the following contents:

#!/bin/bash
PHP_CGI=/usr/bin/php-cgi
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
exec $PHP_CGI

Save and exit :wq!

Command: chmod +x /var/www/cgi-bin/php.fcgi

7. Sample vhost config

{code type=html}

ServerAdmin webmaster@example.com
DocumentRoot /var/www/example.com
ServerName example.com
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
AccessFileName .htaccess
## FastCGI ###
AssignUserId webdev1 webdev1

Options -Indexes FollowSymLinks +ExecCGI
AllowOverride All
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
DirectoryIndex index.php index.html
Order allow,deny
Allow from all


{/code}

9. Restart Apache httpd

Command: service httpd restart

Appendix
APC Howto:

Last Modified: 4 Jun, 2014 at 00:53:02