Apache mod_fastcgi

Apache mod_fastcgi

我正在尝试在 solaris 10 上使用 mod_fastcgi 配置 apache2 服务器,到目前为止,我已经使用 CSW 安装好了一切

这是我的虚拟主机配置

<VirtualHost X.X.X.X:80>
SuexecUserGroup "#1005" "#1006"
DocumentRoot /home/testwh2/public_html
ScriptAlias /cgi-bin/ /home/testwh2/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory />
SetHandler fastcgi-script
Options +ExecCGI
Order Deny,Allow
Allow from all
</Directory>
FastCgiServer /export/httpd/cgi-bin/php
</VirtualHost>

/export/httpd/cgi-bin/php 是到我的 php 解释器的硬链接

这是我的错误日志

FastCGI: comm with (dynamic) server "/home/testwh2/public_html/test.php" aborted: (first read) idle timeout (30 sec)
[Fri Aug 17 12:32:27 2012] [error] [client X] FastCGI: incomplete headers (0 bytes) received from server "/home/testwh2/public_html/test.php"
[Fri Aug 17 12:40:12 2012] [error] [client X] FastCGI: comm with (dynamic) server "/home/testwh2/public_html/test.php" aborted: (first read) idle timeout (30 sec)
[Fri Aug 17 12:40:12 2012] [error] [client X] FastCGI: incomplete headers (0 bytes) received from    server "/home/testwh2/public_html/test.php"

谢谢

编辑:使用此修复http://www.trilithium.com/johan/2005/04/apache2-fastcgi/,只需要 suexec 即可

答案1

删除了 FastCgiServer 指令,现在它运行正常,将很快发布配置以供参考

/etc/httpd.conf

LoadModule fastcgi_module     libexec/mod_fastcgi.so

<IfModule mod_fastcgi.c>
        FastCgiWrapper /opt/csw/apache2/sbin/suexec
        FastCgiconfig -maxClassProcesses 1 -singleThreshold 1 -autoUpdate -idle-timeout 240 -pass-header HTTP_AUTHORIZ
ATION
        AddHandler  fastcgi-script              .fcgi .fcg .fpl
</IfModule>

vhost 配置 ScriptAlias /cgi-bin/ /home/testwh2/cgi-bin/

<Directory "/cgi-bin/">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>

/home/testwh2/cgi-bin/php5.fcgi

#!/bin/bash
export PHPRC="path/to/php.ini"
export PHP_FCGI_CHILDREN=20
export PHP_FCGI_MAX_REQUESTS=5000
exec /usr/local/fc_wrap/php5 "$@"

相关内容