我试图在EC2实例上安装nginx的fast-cgi。 我遵循这里解释的步骤,但是这是为了Debian,并没有开箱即用的基于红帽子的系统。 我修改了一下脚本,看起来像 – #!/bin/bash ### BEGIN INIT INFO # Provides: php-fcgi # Required-Start: $nginx # Required-Stop: $nginx # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts php over fcgi # Description: starts php over fcgi ### END INIT INFO . /etc/rc.d/init.d/functions (( EUID )) && echo .You need to […]
我已经search了一个答案,但似乎无法find任何实质性的有关这个问题。 应该在Apache2.4上使用mod_proxy_fcgi或mod_fastcgi和php-fpm? 在安全性和性能方面是否有区别? 任何build议? 在此先感谢您的帮助。
我需要从nginx提供一些FCGI脚本(通过WSAPI ,但这是无关紧要的)。 目前我正在使用spawn_fcgi来做到这一点。 这是我find的唯一解决scheme。 我需要知道我的其他选项。 有没有其他的方法来运行nginx下的FastCGI?
我很新的nginx和 – 更多的学习目的 – 即时通讯尝试configurationNginx的运行与不同的用户为每个子域的PHP。 例如,我想使用用户john在foo.example.com上的所有脚本和在bar.example.com上的用户jack 。 我已经创build了我的系统上的用户(Ubuntu的服务器),但我不知道如何指示nginx使用用户 – 即时寻找一个解决scheme,可以处理easly许多用户,可以说〜2000年。 看文档,我不明白,如果我必须为每个用户(不同的端口)产生一个php5-cgi进程,然后把它们抓到我的sites-available网站(如我说我是一个新手,但这看起来像我一个服务器自杀),而在nginxconfiguration中只有2个页面是用中文( page1 , page2 )来写的,用google翻译很难翻译(但是,看代码,使用完全不同于server-suicide方式) 任何build议? 更新 galador的答案做的工作,但即时通讯设法build立一个dinamycal环境(与通配符子域名)不需要重新启动nginx / fpm每个新的网站,这可能吗?
我正在将一个传统的Apache服务器转换成Nginx,并没有改变URL或重新安排文件系统的好处。 是否可以在Nginxconfiguration中使用嵌套的位置块来告诉它将正在提供静态内容的别名目录中的.php文件提供给fastcgi? 类似的configuration让我失望: server { listen 80; location / { index index.html; } location /foosite/ { alias /var/aliases/foo; location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } } /foosite/static.jpg的请求服务正常,但nginx似乎试图派遣他们到fastcgipath到任何.php文件。
我正在部署我的第一个Django应用程序。 我熟悉nginx和fastcgi从部署php-fpm。 我不能让Python来识别这些url。 我也在如何进一步debugging这个问题。 我会很欢迎这个问题的解决scheme,并提供关于debuggingfastcgi问题的提示。 目前我得到一个404页面,无论url,并由于某种原因双斜杠对于http://www.site.com/admin/ Page not found (404) Request Method: GET Request URL: http://www.site.com/admin// 我的urls.py来自debugging输出 – 在dev服务器上工作。 Using the URLconf defined in ahrlty.urls, Django tried these URL patterns, in this order: ^listings/ ^admin/ ^accounts/login/$ ^accounts/logout/$ 我的nginxconfiguration server { listen 80; server_name beta.ahrlty.com; access_log /home/ahrlty/ahrlty/logs/access.log; error_log /home/ahrlty/ahrlty/logs/error.log; location /static/ { alias /home/ahrlty/ahrlty/ahrlty/static/; break; } […]
我正在使用FastCGI来设置PHP。 我遵循iis.net网站上的说明。 我添加了处理程序映射,按照指定编辑了php.ini文件。 它没有任何作用,我只是得到一个404.0错误,说“您正在寻找的页面已被删除”,即使错误页面上显示的物理path存在。 尝试这个手动方法后(解压php,手动添加句柄映射等),我删除了一切,我尝试了networking平台安装程序(唉),但我仍然有同样的问题。 多一点信息: 详细错误页面说处理程序是我的StaticFile处理程序(而不是PHP FastCGI)。 它也给错误代码0x80070002 当我查看日志时,显示“GET / php.ini”为404错误。 为什么IIS在寻找?
这个问题的大部分答案是, 设置fastcgi_param SCRIPT_FILENAME,它将工作 (斜体格式化是打破?!)。 我已经设置了这个variables(正确),但它仍然显示错误,而不是404页面,因为问题的根源在这里: location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } 一个不存在的path被传递给php5-fpm,这将返回打印日志中的错误,如下所示: FastCGI sent in stderr: "Unable to open primary script: … (No such file or directory)" while reading response header from upstream 因此,在fastcgi_pass行之前,必须有一个条件来检查文件是否真的存在,或者如果fpm工作返回“找不到文件”,指导nginx返回一个404页面。 我怎样才能做到这一点?
我有两个网站有两个代码库,但是当我更改一个代码库时,我看到了两个网站的变化。 我有两个同一个网站的结帐。 它们被设置为通过Apache2和FastCGI使用PHP-FPM。 结帐在: /var/www/site1 /var/www/site2 Apache的configuration如下所示: <VirtualHost *:80> ServerName site1.myserver.com DocumentRoot /var/www/site1 <IfModule mod_fastcgi.c> AddHandler php5-fcgi-handler .php Action php5-fcgi-handler /php5-fcgi-uri Alias /php5-fcgi-uri fcgi-application FastCgiExternalServer fcgi-application -socket /var/run/site1-fpm.sock -pass-header Authorization -idle-timeout 30000 -flush </IfModule> </VirtualHost> <VirtualHost *:80> ServerName site2.myserver.com DocumentRoot /var/www/site2 <IfModule mod_fastcgi.c> AddHandler php5-fcgi-handler .php Action php5-fcgi-handler /php5-fcgi-uri Alias /php5-fcgi-uri fcgi-application FastCgiExternalServer fcgi-application -socket […]
我有PHP 5.3.3和nginx 0.8.47从运行Wordpress博客的源代码编译。 WordPress生成的RSS feed在16k左右被截断(包括头部为16k + 90b)。 通过添加以下内容到我的nginxconfiguration: fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; 问题就消失了。但是,从我在Nginx wiki页面上读到的内容来看,缓冲区只会决定缓冲区何时会溢出到磁盘上。 没有任何信息表明响应可能被截断,因为缓冲区太小。 所以我的问题是,为什么在更改此设置之前,响应被截断? 看来请求不应该被截断,只是由于磁盘缓冲而慢一点。 附加信息: Ubuntu 10.04.2 32位 PAGESIZE 4k