:: Installing Apache2, FCGI, APC
|
0 |
yum install httpd php-cgi mod_fcgid php-pecl-apc |
:: Enable worker MPM on Apache2
|
0 1 2 |
vi /etc/sysconfig/httpd # uncomment HTTPD=/usr/sbin/httpd.worker |
:: Disable mod_php on Apache2
|
0 1 |
cd /etc/httpd/conf.d/ mv php.conf php.conf.orig |
:: Setup FCGI for php script
+ enable cgi.fix_pathinfo on php.ini
|
0 1 2 |
vi /etc/php.ini # uncomment cgi.fix_pathinfo = 1 |
+ add php script handle on fcgi
|
0 1 2 3 4 5 |
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
|
0 |
vi /var/www/cgi-bin/php-fcgi-daemon |
add these line:
|
0 1 2 3 4 5 |
#!/bin/sh PHPRC=/etc/ export PHPRC export PHP_FCGI_MAX_REQUESTS=5000 export PHP_FCGI_CHILDREN=0 exec /usr/bin/php-cgi |
change permission
|
0 |
chmod 755 /var/www/cgi-bin/php-fcgi-daemon |
+ add +ExecCGI on Options in your vhost / httpd.conf
some like this:
|
0 1 2 3 4 5 |
<Directory /var/www/vhost/htdocs> Options -Indexes FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> |
:: Setup APC
|
0 1 2 |
vi /etc/php.d/apc.ini # change on this line, like: apc.shm_size=128M |
:: Testing configure and restarting httpd
|
0 |
apachectl configtest |
if everything is OK, then restarting Apache2
|
0 |
/etc/init.d/httpd restart |
:: Links
+ Google
+ ThomasNetworks
