免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 7880 | 回复: 12
打印 上一主题 下一主题

[FreeBSD] mod_fcgid + php的fcgi模式不太明白 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-26 09:58 |只看该作者 |倒序浏览
mod_fcgid + php的fcgi模式,这样就不用加载mod_php了,每个进程至少节约5M内存

不太清楚概念 如何配置.这方面的资料太少了..

论坛徽章:
0
2 [报告]
发表于 2007-05-26 11:35 |只看该作者
我也试过。可一但把mod_php屏蔽。用mod_fastcgi解析 始终不行。。。到底要如何用 mod_fastcgi 来解析 php 呢?

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
3 [报告]
发表于 2007-05-26 11:44 |只看该作者
fastcgi是传统cgi的一种改进
php可以运行在cgi也可以运行在fcgi还可以是mod_php

论坛徽章:
0
4 [报告]
发表于 2007-05-26 16:04 |只看该作者
mod_fcgid + php的fcgi模式 如何配置?

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
5 [报告]
发表于 2007-05-26 23:01 |只看该作者
虽然我不知道怎么配置,但是有件事情我却稍微知道一点:就是php可以工作在好几种模式下,既可以用mod方式,也可以用cgi模式。在php的安装帮助文件里好象有说明。
windows下的安装程序里面提到过,现在bsd里的也应该有吧。

论坛徽章:
0
6 [报告]
发表于 2007-05-26 23:56 |只看该作者
除了下面資料我也想多了解些

http://bbs.chinaunix.net/redirec ... amp;goto=nextoldset

论坛徽章:
0
7 [报告]
发表于 2007-05-28 09:39 |只看该作者
这方面的资料比较少.也没人整理出来.郁闷

论坛徽章:
0
8 [报告]
发表于 2007-05-28 11:14 |只看该作者
之前找到較完整的教程,最近忙還沒試
PS:apache22不適用
http://www.dirk.sh/diary/using_mod_fastcgi_with_php_in_apache2

论坛徽章:
0
9 [报告]
发表于 2007-05-28 11:40 |只看该作者
for apache 2.2.0

freebsd上mod_fastcgi for apache 2.2.0补丁
关键词: mod_fastcgi,apa                                          
记叙整理:laozei (http://laozei.blogchina.com/)

在apache 2.2.0上想以fastcgi的方式来运行php,却发现ports里的mod_fastcgi只支持apache 1.3.x和2.0.x,经过几番寻找和尝试,终于在freebsd官方站找到合适的补丁(patch)。

鉴于freebsd官方站被伟大的裤裆给封锁,国内难以访问,遂把此补丁及动作过程记录如下:

1.cd /usr/ports/www/mod_fastcgi

2.把下面的补丁代码复制粘贴到文本文档patch22,路径为:
   /usr/ports/www/mod_fastcgi/patch22
3.打补丁,命令:
patch -p1 <patch22
4.安装mod_fastcgi

附补丁代码:

diff -burN /usr/ports/www/mod_fastcgi/Makefile mod_fastcgi/Makefile --- /usr/ports/www/mod_fastcgi/Makefile Sun Oct 2 09:07:32 2005 +++ mod_fastcgi/Makefile Sun Jan 1 22:29:54 2006 @@ -14,63 +14,19 @@ MAINTAINER= hollywar@mail.holywar.net COMMENT= A fast-cgi module for Apache -BUILD_DEPENDS= ${APXS}{PORTSDIR}/${APACHE_PORT} - CONFLICTS= apache-contrib-1.* -APACHE_COMPAT= YES - -.include <bsd.port.pre.mk> - -.if defined(WITH_APACHE2) || exists(${LOCALBASE}/include/apache2/apr.h) -WITH_APACHE2= YES -MAKEFILE= Makefile.AP2 -USE_REINPLACE= YES -MAKE_ARGS= INCLUDES=-I${PREFIX}/include/apache2 -INSTALL_TARGET= install-modules -PLIST_SUB= APACHE=2 -.else -PLIST_SUB= APACHE= -.endif - -.if defined(WITHOUT_APACHE_SUEXEC) -APXSOPTS+= -DNO_SUEXEC_FOR_AP_USER_N_GROUP -.endif - -do-patch: -.if defined(WITH_APACHE2) - @${REINPLACE_CMD} -e "s|/usr/local/apache2|${PREFIX}/share/apache2|g" ${WRKSRC}/${MAKEFILE} -.else - cd ${WRKSRC} ; ${MV} Makefile.tmpl Makefile ; - -do-build: - cd ${WRKSRC} ; ${LOCALBASE}/sbin/apxs -o mod_fastcgi.so -c ${APXSOPT} *.c - -do-install: - cd ${WRKSRC} ; ${LOCALBASE}/sbin/apxs -i -a -n fastcgi mod_fastcgi.so -.endif +USE_APACHE= 1.3+ +AP_FAST_BUILD= yes +AP_GENPLIST= yes +SRC_FILE= *.c +PORTDOCS= LICENSE.TERMS mod_fastcgi.html post-install: .if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} -.for file in LICENSE.TERMS mod_fastcgi.html - ${INSTALL_DATA} ${WRKSRC}/docs/${file} ${DOCSDIR} + ${MKDIR} ${DOCSDIR} +.for f in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/docs/${f} ${DOCSDIR} .endfor .endif - @${ECHO_MSG} "************************************************************" -.if !defined(WITH_APACHE2) - @${ECHO_MSG} "* Fast-cgi modules was included with your apache *" - @${ECHO_MSG} "* configuration file *" - @${ECHO_MSG} "* *" -.endif - @${ECHO_MSG} "* You need to add following lines to your apache *" - @${ECHO_MSG} "* configuration file. and restart it ! *" - @${ECHO_MSG} "* *" -.if defined(WITH_APACHE2) - @${ECHO_MSG} "* LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so *" -.endif - @${ECHO_MSG} "* AddHandler fastcgi-script fcgi fcgi fpl *" - @${ECHO_MSG} "* *" - @${ECHO_MSG} "************************************************************" - -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff -burN /usr/ports/www/mod_fastcgi/files/patch-apache22 mod_fastcgi/files/patch-apache22 --- /usr/ports/www/mod_fastcgi/files/patch-apache22 Thu Jan 1 01:00:00 1970 +++ mod_fastcgi/files/patch-apache22 Sun Jan 1 22:22:35 2006 @@ -0,0 +1,43 @@ +Originally from +http://fastcgi.com/archives/fast ... ecember/004060.html + +diff -ruN mod_fastcgi-2.4.2/fcgi.h mod_fastcgi-2.4.2-ap22/fcgi.h +--- fcgi.h 2003-02-04 00:07:37.000000000 +0100 ++++ fcgi.h 2005-12-07 21:05:55.000000000 +0100 +@@ -73,6 +73,36 @@ + #define ap_reset_timeout(a) + #define ap_unblock_alarms() + ++/* starting with apache 2.2 the backward-compatibility defines for ++ * 1.3 APIs are not available anymore. Define them ourselves here. ++ */ ++#ifndef ap_copy_table ++ ++#define ap_copy_table apr_table_copy ++#define ap_cpystrn apr_cpystrn ++#define ap_destroy_pool apr_pool_destroy ++#define ap_isspace apr_isspace ++#define ap_make_array apr_array_make ++#define ap_make_table apr_table_make ++#define ap_null_cleanup apr_pool_cleanup_null ++#define ap_palloc apr_palloc ++#define ap_pcalloc apr_pcalloc ++#define ap_psprintf apr_psprintf ++#define ap_pstrcat apr_pstrcat ++#define ap_pstrdup apr_pstrdup ++#define ap_pstrndup apr_pstrndup ++#define ap_push_array apr_array_push ++#define ap_register_cleanup apr_pool_cleanup_register ++#define ap_snprintf apr_snprintf ++#define ap_table_add apr_table_add ++#define ap_table_do apr_table_do ++#define ap_table_get apr_table_get ++#define ap_table_set apr_table_set ++#define ap_table_setn apr_table_setn ++#define ap_table_unset apr_table_unset ++ ++#endif /* defined(ap_copy_table) */ ++ + #if (defined(HAVE_WRITEV) && !HAVE_WRITEV && !defined(NO_WRITEV)) || defined WIN32 + #define NO_WRITEV + #endif diff -burN /usr/ports/www/mod_fastcgi/pkg-plist mod_fastcgi/pkg-plist --- /usr/ports/www/mod_fastcgi/pkg-plist Thu Jun 19 16:41:36 2003 +++ mod_fastcgi/pkg-plist Thu Jan 1 01:00:00 1970 @@ -1,4 +0,0 @@ -libexec/apache%%APACHE%%/mod_fastcgi.so -%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TERMS -%%PORTDOCS%%%%DOCSDIR%%/mod_fastcgi.html -%%PORTDOCS%%@dirrm %%DOCSDIR%%

注:复制上来有点乱,不知道能不能用。不能用的话请到下面地址获取(前提:能穿过GCD的封锁)
http://www.freebsd.org/cgi/query-pr.cgi?pr=91190

论坛徽章:
0
10 [报告]
发表于 2007-05-28 14:16 |只看该作者
原帖由 ezgo 于 2007-5-28 11:14 发表
之前找到較完整的教程,最近忙還沒試
PS:apache22不適用
http://www.dirk.sh/diary/using_mod_fastcgi_with_php_in_apache2

ezgo
ths
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP