apache-worker & php5 & mod_fastcgi

December 16, 2009

[sourcecode language='sh']
cd /usr/ports/www/apache22
make WITH_MPM=worker install clean
[/sourcecode]

[sourcecode language='sh']
cd /usr/ports/lang/php5; make install clean
[/sourcecode]

[sourcecode language='sh']
cd /usr/ports/www/mod_fastcgi
make install clean
[/sourcecode]

httpd.conf 中新增or把註解拿掉這兩行
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so
Include etc/apache22/extra/httpd-mpm.conf

編輯
/usr/local/etc/apache22/extra/httpd-mpm.conf
[sourcecode language='sh']
ThreadLimit 512
StartServers 1
MaxClients 512
MinSpareThreads 1
MaxSpareThreads 512
ThreadsPerChild 512
MaxRequestsPerChild 0
[/sourcecode]

新增/usr/local/etc/apache22/Includes/fastcgi.conf
[sourcecode language='sh']
AddType application/x-httpd-php .php

ScriptAlias /php-fcgi “/usr/local/bin/php-cgi”

FastCgiServer “/usr/local/bin/php-cgi” -initial-env PHP_FCGI_CHILDREN=32


Options ExecCGI FollowSymLinks
SetHandler fastcgi-script
Order allow,deny
Allow from all

Action application/x-httpd-php /php-fcgi
[/sourcecode]

ps
若之前php 是用php5_module來啟的話
記得把相關的php 都重編…
不然會一直出現
kernel: pid 86212 (php-cgi), uid 80: exited on signal 11
若一直出現這個就先把extension 都先拔掉

ref.

http://blog.wu-boy.com/2008/09/13/388/

http://blog.gslin.org/archives/2008/08/17/1624/

wens’s comment on http://blog.gslin.org/archives/2008/08/17/1624/

tags:
posted in FreeBSD by johnpupu

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org