Fastcgi错误 - 错误日志中的FastCgiIpcDir问题

问题描述 投票:1回答:1

错误日志中的FastCgiIpcDir问题

嗨,

我在Apache错误日志中注意到以下错误(错误1):

[Wed Feb 08 14:00:06 2012] [alert] [client 41.185.88.175] (2)No such file or  directory: FastCGI: failed to connect to (dynamic) server "/var/www/bin/php-splashpage-user/php-fastcgi": something is seriously wrong, any chance the socket/named_pipe directory was removed?, see the FastCgiIpcDir directive

之后直接出现此错误(错误2):

[Wed Feb 08 14:00:06 2012] [error] [client 41.185.88.175] FastCGI: incomplete headers (0 bytes) received from server "/var/www/bin/php-splashpage-user/php-fastcgi"

如何修复错误1?

我读到了由于主机系统定期清除“/ tmp”目录(如果没有定义fastCgiIpcDir的默认目录)而导致更改此问题,从而消除了与当前活动的FastCGI服务的通信。所以我决定试一试。为了成功,我在fastcgi.conf文件中设置了FastCgiIpcDir,但根本没有变化。

这是我的fastcgi.conf文件的内容:

<IfModule mod_fastcgi.c>
    FastCgiIpcDir /var/lib/apache2/fastcgi_test
    FastCgiConfig -idle-timeout 60 -maxClassProcesses 1
    FastCgiWrapper On

    AddHandler php5-fcgi .php
    Action php5-fcgi /cgi-bin/php-fastcgi

    <Location "/cgi-bin/php-fastcgi">
            Order Deny,Allow
            Deny from All
            Allow from env=REDIRECT_STATUS
            Options ExecCGI
            SetHandler fastcgi-script
    </Location>
</IfModule>

/ var / lib / apache2 / fastcgi_test的权限和服务:

drwxr-xr-x  3 www-data www-data 4.0K 2012-02-08 09:20 fastcgi_test

我的php包装器脚本php_fastcgi有以下几行:

#!/bin/sh

PHP_FCGI_CHILDREN=120
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_MAX_REQUESTS

umask 0022
exec /usr/bin/php-cgi -d apc.shm_size=50

我正在运行PHP 5.3.1,Apache / 2.2.14,Ubuntu 10.04。

到目前为止,我收集了以下几件事:

  • 错误1仅出现在新小时后的一小时开始,即6秒

通过使用mod_FastCgi,我了解到增加子进程有助于减轻一些“错误2”错误(这会导致随机间隔的HTTP 500错误)。目前我不太清楚错误1的影响是什么,但是如果错误2直接在那之后,那么可以说这不是一件好事。

关于Fastcgi使用经过试验和测试的解决方案报告的错误的信息非常少(如果有的话)。可悲的是,我可能只是添加到网上发布的一堆Fastcgi错误而没有结论。

您将很容易理解您在解决错误1方面的帮助,建议或提示。

apache2 fastcgi
1个回答
0
投票

我不知道如何使用包装器和suexec,但你应该尝试这个:

http://blog.kmp.or.at/2013/06/apache-2-2-on-debian-wheezy-w-php-fpm-fastcgi-apc-and-a-kind-of-suexec/

链接中的解决方案甚至不使用suexec,也不使用包装器,这种方式至少可以使用。

所需的步骤:

0)安装php5-fpm,如果尚未安装apache-mpm-worker

1)评论这一行:

#FastCgiWrapper On

2)别名:

Alias /cgi-bin/php-fastcgi **/var/something**

3)fastcgiexternalserver:

FastCgiExternalServer **/var/something** -socket php5-fpm-site1user.sock

(强类型路径必须相同)

4)在php5-fpm / pool.d / site1user.conf中设置conf

[site1user]
user = site1user
group = site1user

listen = /var/run/php5-fpm-site1user.sock

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

chdir = /

5)重启fpm服务php5-fpm重启

6)为了更深入的了解,请在此查看我的其他答案

https://serverfault.com/questions/524708/php5-fpm-apache2-on-wheezy-connect-failed-with-fastcgi/536277#536277

© www.soinside.com 2019 - 2024. All rights reserved.