Articles of FastCGI的

为什么php-fgi的php-cgi包装器脚本? (使用虚拟主机和suexec。)

我只是用Apache,FastCGI和PHP-FPM设置我的服务器。 我的问题是关于/ cgi-bin /文件夹:是否真的有必要为每个使用不同用户/组运行apache的单个虚拟主机提供一个/ cgi-bin / php-fpm包装? 而且,如果用户删除了cgi-bin文件夹,那么fpm / fastcgi的好处将会丢失。 理想情况下,我想设置PHP-FPM,而不需要.conf文件之外的任何东西。 据我所知,php-cgi二进制文件(这就是php-fpm包装器执行的所有内容)可以被系统上的所有用户执行…那么为什么包装要运行的同一个可执行文件的麻烦用户呢? 更具体地说,我怎样才能改变这个configuration直接使用php-cgi二进制文件,而不是通过包装? 与我的问题有关的文件/结果是: /etc/apache2/modules.d/20_mod_fpm.conf ————————————————– ——————————- … FastCgiExternalServer / var / www / localhost / cgi-bin / php-fpm -host 127.0.0.1:9000 AddHandler php-fpm .php 动作php-fpm / cgi-bin / php-fpm DirectoryIndex index.php … 在/ var / WWW /本地主机/ cgi-bin目录/ PHP-FPM ————————————————– ——————————- #!的/ usr / bin中/ […]

Nginx目录别名错误地传递给fcgi

我有一个网站虚拟主机,example.com,这是静态服务的/ home / erealms / www。 但是,该网站通过一系列perl脚本运行,这些脚本位于各种目录中。 所以我想要做的是以下几点: http://example.com/ -> /home/erealms/www http://example.com/erealms -> /home/erealms/ethereal/main http://example.com/erealms/admin -> /home/erealms/ethereal/mgmt/admin http://example.com/erealms/config -> /home/erealms/ethereal/mgmt/config 在除http://example.com/之外的所有目录中,将会有通过fcgiwrapper提供的perl文件.pl。 这是我目前的configuration: server { add_header Cache-Control public; access_log /var/log/nginx/access.log main buffer=32k; error_log /var/log/nginx/error.log error; expires max; limit_req zone=gulag burst=200 nodelay; listen 80; server_name example.com; index index.html index.htm default.html default.htm; root /home/erealms/www; location ~* (\.jpg|\.png|\.css)$ { […]

lighttpd fastcgi unix绑定错误

我试图configurationLighttpd使用FastCGI运行Redmine。 我已经将下面的代码添加到我的标准lighttpd.conf : $HTTP["host"] =~ "^foo.bar.com$" { server.document-root = "/usr/share/redmine/public/" index-file.names += ( "dispatch.fcgi" ) #dispatch.fcgi if rails specified server.error-handler-404 = "/dispatch.fcgi" #too fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/var/run/lighttpd/rails-fastcgi.sock", "bin-path" => "/usr/share/redmine/public/dispatch.fcgi" ) ) ) } 当我尝试启动lighttpd服务器时,我在错误日志中得到以下内容: May 11 10:24:05 ohio lighttpd[5527]: (log.c.166) server started May 11 10:24:05 ohio […]

在重新编译之后用apache / php指定“没有指定input文件”

我有CPanel,我重新编译了PHP到5.3.13,并且即时获取“没有指定input文件”的网站,如vB和MyBB运行在fcgi和suEXEC(与以前相同的模式)。 build立我已经检查:Mod SuPHP国防部FCGID MPM Prefork 据我所知,当我做了重新编译没有选项被改变。 我一直在运行5.3.8 任何想法可能是什么原因造成的? 其他网站工作和运行得很好。 php -v PHP 5.3.13 (cli) (built: Jun 5 2012 08:56:58) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator with the ionCube PHP Loader v4.0.12, Copyright (c) 2002-2011, by ionCube Ltd., and […]

如何判断:是nginx还是PHP-cgi比较慢?

我运行一个网站,交通很多。 我使用nginx和php fast-cgi。 但是,当在浏览器中加载简单的php文档时,加载页面之前需要5-6秒的时间。 有时甚至会导致“404找不到”nginx错误。 在debian上使用“htop”时,我远不及使用服务器的资源。 发生什么了? 这是nginx吗? 它是PHP的快速CGI? 我不知道瓶颈在哪里。 我的nginxconfiguration的一个片段: 用户www-data www-data; worker_processes 2; 事件{ worker_connections 4048; } http { 包括mime.types; default_type application / octet-stream; 发送文件; #tcp_nopush在; keepalive_timeout 10; include / usr / local / nginx / sites-enabled / *; … } 我的fast-cgiconfiguration的一个片段: EXEC_AS_USER = WWW的数据 #FASTCGI-Listener的主机和TCP端口(默认:localhost:9000) FCGI_HOST =本地主机 FCGI_PORT = 9000 #环境variables,由PHP处理 PHP_FCGI_CHILDREN […]

当PHP-Fpm正在处理时,Nginxclosures连接

我有一个PHP脚本,做一些数据处理。 脚本完成所有工作所需的时间取决于用户的input。 这是不寻常的,需要5-15分钟的处理。 在Apache上一切正常,但在Nginx的连接刚刚closures。 处理时间很less,一切都很好。 问题来源于长期的要求… 没有任何日志中的错误。 我怀疑浏览器closures了连接。 我嗅探了头文件,Nginx似乎没有发送任何响应,直到处理完成。 没有一个头。 我尝试从脚本发送头文件,但似乎nginxcaching所有。 之后,我禁用了PHP输出缓冲并启用了隐式刷新。 我禁用了gzip压缩和zlib。 我将FAST_CGI_BUFFERS最小化为允许的最小值,即:fastcgi_buffers 2 1k; fastcgi_buffer_size 1k; fastcgi_busy_buffers_size 1k; fastcgi_max_temp_file_size 0; 不过,它拒绝发送标题… 所以只是为了certificate我的情况,在代码中的循环之一,我做了一个var_export的对象之一… 繁荣!!! – 有用… 任何人都可以想到更优雅的解决scheme? 谢谢。 8月19日更新 疯狂的事情正在发生。 在我尝试了两天没有任何运气的情况下进行debugging之后,我尝试了一些我以前应该做的事情。 我在Linode上尝试过这个configuration,它工作! 所以可能这个问题是在Ubuntu的configuration…不知道在哪里看。

Nginx和Nagios通过FastCGI处理程序,403错误

我目前正在从事Web平台的更新工作,并将Apache从Apache切换到Nginx。 所以我必须在做之前testing我们所有的pipe理和内部应用程序。 那么到目前为止,我并没有遇到任何问题,但是如果没有这个问题,它会有点过于简单:D 所以,今天,我使用以下组件安装我的监督平台: 操作系统:Debian挤压6.0.6 WebServer:Nginx 1.2.5 FastCGI:fcgiwrap 1.0.3-3 PhpCGI:php 5.4.11 监督:Nagios 3.4.3 这是我的目录结构: /usr/local/$APPNAME$/$SUBTREE$ –> Aim for all binaries and libraries outside the OS. /etc/$APPNAME$/$SUBTREE$ –> Directory for all binaries configuration files. /srv/apps/$WEBAPPNAME$/$SUBTREE$/ –> Directory for all HTML/PHP/CGI related files. 以下这些我有: /usr/local/nagios/ all owned by nagios user/group. /usr/local/nginx/ all owned by nginx user/group. /usr/local/fcgiwrap/ […]

无法获得RT的新实例启动

我试图从CentOS 4服务器移植一个RT 4.0.1实例(本地代码定制)到CentOS 6服务器。 我的问题似乎是我无法启动fastcgi脚本。 当apache启动时,会出现这个错误: [Mon Mar 25 12:37:37 2013] [warn] FastCGI: server "/opt/rt4/sbin/rt-server.fcgi" (uid 48, gid 48) restarted (pid 1504) suexec policy violation: see suexec log for more details [Mon Mar 25 12:37:37 2013] [warn] FastCGI: server "/opt/rt4/sbin/rt-server.fcgi" (pid 1504) terminated by calling exit with status '107' [Mon Mar 25 12:37:38 2013] [warn] […]

Debian上的PHP5-FPM + Apache2 Wheezy:connect()与FastCGI失败

我在Debian Wheezy上有这个错误,我不明白我在想什么。 从php5-fpm的日志是确定的。 来自apache2日志的错误 : [error] (2)No such file or directory: FastCGI: failed to connect to server "/var/lib/apache2/fastcgi/php5.fastcgi": connect() failed [error] FastCGI: incomplete headers (0 bytes) received from server "/var/lib/apache2/fastcgi/php5.fastcgi" fastcgi.conf的内容: <IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi #FastCgiWrapper /usr/lib/apache2/suexec FastCgiIpcDir /var/lib/apache2/fastcgi </IfModule> php5-fpm.conf的内容: <IfModule mod_fastcgi.c> Alias /php5.fastcgi /var/lib/apache2/fastcgi/php5.fastcgi AddHandler php-script .php FastCGIExternalServer /var/lib/apache2/fastcgi/php5.fastcgi -socket /var/run/php5-fpm.sock -idle-timeout […]

使用Apache Handler通过FastCGI重新安装Apache

目前我们正在用fastcgi运行apache。 这就是我们的phpinfo上说的: Server API CGI/FastCGI 我们需要把它改成Apache。 我该怎么做呢?