:: CentOS: Apache2 worker MPM, FCGI, APC

45 sec read

:: Installing Apache2, FCGI, APC

yum install httpd php-cgi mod_fcgid php-pecl-apc

 
:: Enable worker MPM on Apache2

vi /etc/sysconfig/httpd
# uncomment
HTTPD=/usr/sbin/httpd.worker

 
:: Disable mod_php on Apache2

cd /etc/httpd/conf.d/
mv php.conf php.conf.orig

 
:: Setup FCGI for php script
+ enable cgi.fix_pathinfo on php.ini

vi /etc/php.ini
# uncomment
cgi.fix_pathinfo = 1

+ add php script handle on fcgi

vi /etc/httpd/conf.d/fcgid.conf
# add fcgi for php
AddHandler fcgid-script .php
FCGIWrapper /var/www/cgi-bin/php-fcgi-daemon .php
AddType text/html .php
DirectoryIndex index.php

+ create FCGIWrapper

vi /var/www/cgi-bin/php-fcgi-daemon

add these line:

#!/bin/sh
PHPRC=/etc/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_CHILDREN=0
exec /usr/bin/php-cgi

change permission

chmod 755 /var/www/cgi-bin/php-fcgi-daemon

+ add +ExecCGI on Options in your vhost / httpd.conf
some like this:


      Options -Indexes FollowSymLinks +ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all

 
:: Setup APC

vi /etc/php.d/apc.ini
# change on this line, like:
apc.shm_size=128M

 
:: Testing configure and restarting httpd

apachectl configtest

if everything is OK, then restarting Apache2

/etc/init.d/httpd restart

 
:: Links
+ Google
+ ThomasNetworks

How to fix problem with…

Facing a Git error with the 'vi' editor? Discover how to easily fix it by checking your Vim path and configuring Git to use...
Sysadmin.ID
10 sec read

Apache :: MP4 Streaming

Learn how to enable MP4 streaming in Apache with the installation of the mod_h264 streaming module, making your video content accessible and efficient. Follow...
Sysadmin.ID
18 sec read

Apache :: Flash / FLV…

Learn how to effortlessly configure Apache for FLV streaming by installing the mod_flvx module and updating your httpd.conf file. Discover the simple steps to...
Sysadmin.ID
15 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *