文章列表
 
您正在查看 "Cgi" 分类下的文章

2007年12月11日 星期二 14:17
自2004年4月份以后,Fastcgi官方未曾再对其修改过。由于Apache(实为libapr)版本的更新,有很多人为Fastcgi做了补丁程序。

整整过了三年,Fastcgi终于于2007年11月13日发布了其新的版本2.4.6(由日志可以看到程序是在2007年的4月末就修改了)。


其新版本变化大致如下:
1.对新版本的apache的支持,解决以前只有打了补丁程序才能编译通过的问题。
2.对apache新版本的相关函数的变动而做了相应的修改。
 
2007年08月15日 星期三 0:45
我的服务器上已经装好apache2了, 今天想装一个FastCGI上去, 于是从http://www.fastcgi.com/dist/下载了http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz, 解压, 编译并安装:

$/usr/local/apache/bin/apxs -n mod_fastcgi.so -i -a -c *.c

结果出错了:
mod_fastcgi.c: In function `init_module':

mod_fastcgi.c:270: `ap_null_cleanup' undeclared (first use in this function)
mod_fastcgi.c:270: (Each undeclared identifier is reported only once mod_fastcgi.c:270: for each function it appears in.)

找了好长时间的原因, 终于找到答案了:
原来apache2已经将ap_null_cleanup名字变为
apr_pool_cleanup_null了, 还有一些名字也变了.
解决的办法:
手动修改mod_fastcgi-2.4.2/fcgi.h文件(注意以加号开始的行表示新添加的):
 #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
然后保存文件, 重新编译安装.
 
2007年08月14日 星期二 16:19

1. FastCGI 像是一个常驻 (long-live) 型的 CGI,它可以一直执行着,只要激活后,不会每次都要花费时间去 fork 一次 (这是 CGI 最为人诟病的 fork-and-execute 模式)。
2. FastCGI 可在任何平台上使用,Netscape Enterprise 及 IIS 都有 FastCGI 的模块可供使用,阿帕契 (Apache,以及利用 Apache 衍生出做的服务器) 上也有 mod_fastcgi 可用。
3. FastCGI 支持 C/C++,Ruby, Perl,Tcl,Java,Python 等程序语言。
4. FastCGI 的应用程序亦兼容于 CGI。即 FastCGI 的应用程序也可以当成 CGI 来执行。
5. 现有的 CGI 程序要改写成 FastCGI 非常简单,最少可能只需要多加入三行程序代码。
6. FastCGI 的侦错方式与 CGI 大同小异,只要带入程序所需的环境变量及参数,即可在命令列模式执行或侦错。
7. FastCGI 应用程序的写作方式与 CGI 类似,除了几项原则要特别注意外,FastCGI 的写作方式跟 CGI 几乎一样,与学习 Web Server API 比较起来, FastCGI 简单多了。
8. FastCGI 支持分布式运算 (distributed computing),即 FastCGI 程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。

 
 
   
 
 
文章分类
 
   
 
文章存档
 
     
 
最新文章评论
  

[表情]
 

问题解决,谢谢分享~
 

做了没有?
 

太长知识了,这两天我也老犯这毛病
 

非常感谢~学习了~
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu