FreeBSD Configure Apache 2.2 PHP with FastCGI…
2009-05-13 13:39:38来源:未知 阅读 ()
[url=javascript:;]FreeBSD[/url]
7 release along with following software:
+
[url=javascript:;]Apache[/url]
2.2
+
[url=javascript:;]PHP[/url]
as mod_php5
+ MySQL DB 5.1.23 server
How do I configure php as
[url=javascript:;]FastCGI[/url]
server?
A.mod_fcgid has a newprocess management strategy, which concentrates on reducing the numberof fastcgi server, and kick out the corrupt fastcgi server as soon aspossible. It is abinary compatibility alternativeto Apache
[url=javascript:;]module[/url]
mod_fastcgi; so your existing fastcgi programs do not need to be recompiled. mod_fcgid supports suEXEC.
Why run PHP5 as
[url=javascript:;]mod_fcgi[/url]
/ mod_fastcgi?FastCGI as has some serious advantages over mod_php5:
- You can do user level separations. You can enable quotas per user. Limit users by processes and CPU consumption.
- chroot security call per user possible
- According to several reports fastcgi works much faster than mod_php and cgi mode.
[url=javascript:;]ports[/url]
are upto date:
# portsanp fetch update
Install mod_fcgid:
# make install clean
Make sure php supports FastCGIMake sure php-cgi binary exists and it is compiled with fastcgi support:
# cd /usr/ports/lang/php5
# make showconfig | grep -i FASTCGI
Output:
FASTCGI=on "Enable fastcgi support (CGI only)"Another way to test fastcgi support, enter:
# /usr/local/bin/php-cgi -v
Output:
/usr/local/bin/php-cgi -v
PHP 5.2.5 with Suhosin-Patch 0.9.6.2(cgi-fcgi)(built: Mar 6 2008 09:15:41)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
If you don't see word cgi-fcgi, recompile php with fastcgi support by visiting /usr/ports/lang/php5
# cd /usr/ports/lang/php5
# make config
# make install clean
Step # 3: Load mod_fcgi moduleOpen your httpd.conf file located at /usr/local/etc/apache22/ directory:
# vi /usr/local/etc/apache22/httpd.conf
Load mod_fcgi module:
LoadModule fcgid_module libexec/apache22/mod_fcgid.so
Configure mod_fcgi
AddHandlerfcgid-script.fcgi
FCGIWrapper /usr/local/bin/php-cgi .php
Find your DocumentRoot directory configuration option that read as follows:
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- Freebsd oracle 10g 2009-05-13
- FreeBSD下nginx+fast-cgi+mysql+zend的实现 2009-05-13
- KDE/FreeBSD 测试 QT-4.5.1. 2009-05-13
- freebsd系统共享上网问题! 2009-05-13
- OpenBSD 4.5下安装Gnome 2.24成功! 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash