:: 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 the editor ‘vi’

:: git error with vi error: There was a problem with the editor 'vi'   :: how to fix the problem 0. check path...
Sysadmin.ID
10 sec read

Apache :: MP4 Streaming

:: How to Enable mp4 Streaming in Apache + Installing mod h624 streaming wget //h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz tar -xzf apache_mod_h264_streaming-2.2.7.tar.gz cd mod_h264_streaming-2.2.7/ ./configure --with-apxs=`which apxs2` make...
Sysadmin.ID
18 sec read

Apache :: Flash / FLV Streaming

:: How to Configure Apache for FLV Streaming + Installing mod_flvx wget //people.apache.org/~pquerna/modules/mod_flvx.c which apxs /usr/bin/apxs /usr/bin/apxs -cia mod_flvx.c + setup mod_flvx in http.conf...
Sysadmin.ID
15 sec read

Leave a Reply

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