我有一个启用了 Lighttpd 和 fastcgi 的 Centos 5 系统。它记录访问但不记录错误。我有内部服务器错误 500 并且日志中没有信息,当我尝试打开不存在的文件时 - 错误日志中也没有信息。如何正确启用它?
下面是我启用的模块列表:
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_alias",
# "mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
# "mod_auth",
"mod_status",
"mod_setenv",
"mod_fastcgi",
# "mod_webdav",
# "mod_proxy_core",
# "mod_proxy_backend_fastcgi",
# "mod_proxy_backend_scgi",
# "mod_proxy_backend_ajp13",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )
Run Code Online (Sandbox Code Playgroud)
下面是调试的设置:
## enable debugging
#debug.log-request-header = "enable"
#debug.log-response-header = "enable"
#debug.log-request-handling = "enable"
debug.log-file-not-found = "enable"
#debug.log-condition-handling = …
Run Code Online (Sandbox Code Playgroud) 错误日志:
[Sat Nov 22 05:24:41 2014] [error] [client xx] (2)No such file or directory: FastCGI: failed to connect to server "/usr/lib/cgi-bin/php5-fcgi": connect() failed
[Sat Nov 22 05:24:41 2014] [error] [client xx] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
Run Code Online (Sandbox Code Playgroud)
嗯,这个文件/usr/lib/cgi-bin/php5-fcgi
确实丢失了,cgi-bin
文件夹中实际上什么都没有。当我重新启动 apache2 时,它似乎工作正常:
[Sat Nov 22 04:46:29 2014] [notice] FastCGI: process manager initialized (pid 10747)
[Sat Nov 22 04:46:29 2014] [notice] Apache/2.2.22 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_ssl/2.2.22 OpenSSL/1.0.1 configured -- resuming normal operations
Run Code Online (Sandbox Code Playgroud)
/etc/apache2/conf.d/php-fpm.conf
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi …
Run Code Online (Sandbox Code Playgroud) 我在 nginx.conf 上的 http 块上使用以下配置:
fastcgi_cache_path /var/www/nginx_cache levels=1:2 keys_zone=NGINXCACHE:500m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
Run Code Online (Sandbox Code Playgroud)
这适用于此 nginx 服务器上托管的所有网站。我想知道是否可以将每个网站缓存文件存储在特定文件夹下,例如:
当我 daclare 多个 fastcgi_cache_path 的 nginx 启动给我一个错误,即使有不同的区域。
此致。
当我尝试在 ubuntu 服务器 12.04 中安装 fastcgi 时,出现以下错误:
sudo apt-get install libapache2-mod-fastcgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapache2-mod-fastcgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-fastcgi' has no installation candidate
Run Code Online (Sandbox Code Playgroud)
有什么解决办法吗?
我有一个 FastCGI (mod_fastcgi) 问题。它每隔一段时间就会发生一次,并且不会导致服务器完全崩溃,只会出现 500 个错误。这里有几件事。首先我使用 APC,所以 PHP 可以控制它自己的进程,而不是 FastCGI。另外,我将 webroot 设置为:
/var/www/html
Run Code Online (Sandbox Code Playgroud)
还有里面的 fcgi-bin:
/var/www/html/fcgi-bin
Run Code Online (Sandbox Code Playgroud)
首先是 apache error_log:
[Fri Jan 07 10:22:39 2011] [error] [client 50.16.222.82] (4)Interrupted system call: FastCGI: comm with server "/var/www/html/fcgi-bin/php.fcgi" aborted: select() failed, referer: http://www.domain.com/
Run Code Online (Sandbox Code Playgroud)
我还在“fcgi-pm”过程中运行了 strace。这是它爆炸时的跟踪片段:
21725 gettimeofday({1294420603, 14360}, NULL) = 0
21725 read(14, "C /var/www/html/fcgi-bin/php.fcgi - - 6503 38*", 16384) = 46
21725 alarm(131) = 0
21725 select(15, [14], NULL, NULL, NULL) = 1 (in [14])
21725 alarm(0) = 131
21725 gettimeofday({1294420603, 96595}, …
Run Code Online (Sandbox Code Playgroud) 我有两个站点,我在 Ubuntu 12.04 上使用 PHP-FPM 5.4 从 apache 2.2 虚拟主机运行。到目前为止,我一直在使用服务器范围的(库存)mod_fastcgi 配置,但现在我想将其拆分为两个 FPM 池,以便我可以为每个池使用不同的 PHP 设置(例如,一个是开发站点,因此启用了错误显示) )。
我已经根据文档设置了两个具有不同名称和套接字位置的 FPM 池,禁用了全局 fastcgi 配置,将其复制到我的 vhost 中,并将其更改为指向每个 vhost 的不同池,如下所示:
<IfModule mod_fastcgi.c>
<FilesMatch \.php$>
SetHandler php-script
</FilesMatch>
Action php-script /php5.fcgi virtual
Alias /php5.fcgi /var/fastcgi/php5.fcgi
FastCGIExternalServer /var/fastcgi/php5.fcgi -socket /var/run/php5-fpm-www.sock
<Directory "/var/fastcgi">
Order allow,deny
<Files "php5.fcgi">
Order deny,allow
Deny from all
Allow from env=REDIRECT_STATUS
</Files>
</Directory>
</IfModule>
Run Code Online (Sandbox Code Playgroud)
实际上有 4 个虚拟主机,因为每个主机名都有常规和 SSL 风格,并且每一对都指向一个 FPM 池。
我遇到的问题是 apache 抛出一个错误说:
FastCgiExternalServer: redefinition of previously defined class "/var/fastcgi/php5.fcgi"
Run Code Online (Sandbox Code Playgroud)
这应该怎么做?
运行 apache httpd 2.2.11 和 fastcgi 的 debian lenny 服务器在请求超过特定秒数时终止请求。我想禁用此超时以使我能够调试使用 fastcgi 启动的应用程序。
我已经在 apache 和 lighttpd 文档中搜索过,但找不到任何东西(只有空闲超时之类的选项,我认为这里不是这种情况)。
有谁知道如何控制这个超时?谢谢。
我最近在专用服务器 (LINUX) 上遇到了问题,其中文件系统变为只读。
最近的修改包括在某些<VirtualHost>
帐户上使用 PHP 5,2 安装 fcgid 。
系统范围的 PHP 是 PHP 5.3
我已经浏览了日志,但找不到任何会引起警报的内容。
任何帮助/建议将不胜感激。
有人试过在 CentOS7/httpd 上安装 mod_fastcgi 吗?
由于它不在 epel 或 fusion 存储库中,我尝试了 el6 rpm,它不起作用(httpd 说:无法将模块/mod_fastcgi.so 加载到服务器中:/etc/httpd/modules/mod_fastcgi.so:未定义符号:unixd_config )。
从源代码编译 mod_fastcgi (# make top_dir=/usr/lib64/httpd) 也失败了,出现了数千个这样的错误:
/usr/include/httpd/http_config.h:574:32: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2881:5: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type [enabled by default]
ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, "FastCGI: access denied: %s", r->uri);
Run Code Online (Sandbox Code Playgroud)
SELINUX 已被禁用(以排除“拒绝访问”的原因)
我还安装了编译fastcgi的要求:httpd-devel libtool make gcc apr apr-devel。
由于 mod_fastcgi 恕我直言是连接到 PHP-FPM 的常用方法,我真的无法想象 fastcgi 不适用于 CentOS 7,所以我认为我做错了什么。
不幸的是,mod_proxy 对套接字连接的支持从 httpd 2.4.10 开始,而 CentOS 7 存储库只有 …
mod-fastcgi ×9
apache-2.2 ×6
fastcgi ×4
php ×2
500 ×1
centos7 ×1
httpd ×1
installation ×1
lighttpd ×1
linux ×1
log-files ×1
nginx ×1
php-fpm ×1
php5 ×1
ubuntu-12.04 ×1