您的位置:首页 > 理论基础 > 计算机网络

lazarus开发apache下fastcgi应用,如何配置httpd.conf文件

2012-11-26 21:21 531 查看
以lazarus附带的fastcgi例程为例子:

lazarus\fpc\2.6.0\source\packages\fcl-web\examples\helloworld\fcgi,

1、用lz打开并编译,得到helloworld.exe文件;

2、将其复制到Apache2.2\cgi-bin目录,这一步并非必须,只是为了操作方便。

3、下载http://www.fastcgi.com/dist/mod_fastcgi-2.4.6-AP22.dll,复制到Apache2.2\modules目录,并改名为:mod_fastcgi.so。

4、配置httpd.conf文件。

.......

LoadModule fastcgi_module modules/mod_fastcgi.so

......

fastcgiexternalserver "cgi-bin/hello-fastcgi" -host localhost:2015 -idle-timeout 30 -flush

注意此处2015与前面程序helloworld.lpr中端口必须一致:

Application.Port:=2015;

5、重启apache,启动helloworld.exe。

6、浏览器打开地址:

http://localhost/cgi-bin/hello-fastcgi/func1call

第二个配置例子:

......

LoadModule fastcgi_module modules/mod_fastcgi.so

......

<IfModule mod_fastcgi.c>
<Directory "D:/apache2.2/cgi-bin/t0115">
Order allow,deny
Allow from all
</Directory>

#External FCGI app, 必须人工启动该程序, Apache 不会启动它
FastCgiExternalServer "D:/apache2.2/cgi-bin/t0115/windweb.exe" -host localhost:8027 -idle-timeout 30 -flush

#optionally, to shorten the calling URL and to not display the executable file name (if used, no +ExecCGI is needed above)
ScriptAlias /wind "D:/apache2.2/cgi-bin/t0115/windweb.exe"
</IfModule>


访问:

http://localhost/wind/modleinfo/info

modleinfo:模块名称,info:action名称。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: