我讨厌configurationnginx。 这太复杂了 我如何让PHP在我的用户目录中工作? 这里是我的nginx.conf的相关部分: location ~ ^/~(.+?)(/.*)?$ { autoindex on; autoindex_exact_size off; alias /home/$1/public_html$2; location ~ \.php { include /etc/nginx/fastcgi.conf; fastcgi_intercept_errors on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; } } 这给了我错误: FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream在nginx错误日志中FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream 。 […]
我试图用DAViCal设置nginx。 然而,我得到了一个“文件未find”与“发送stderr FastCGI:”主要脚本未知“在日志。看起来有什么错我的别名,但我确定无法弄清楚。 我的虚拟主机: server { listen 80; ## listen for ipv4; this line is default and implied listen [::]:80 default_server ipv6only=on; ## listen for ipv6 root /var/www-data; index index.html index.htm index.shtml index.php; # Make site accessible from http://localhost/ server_name just.a.server; location / { # First attempt to serve request as file, then # as […]
我有一个启用Lighttpd和fastcgi的Centos 5系统。 它logging访问,但不logging错误。 我有内部服务器错误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" ) […]
我正在通过FastCGI将最新版本的PHP安装到IIS 7.5上,并且所有的说明都指出FastCGI应该通过设置来模拟调用客户端 fastcgi.impersonate = 1 如果我的网站将有这个configuration 专用应用程序池 ApplicationPoolIdentity的应用程序池标识 仅限匿名身份validation(如IUSR) 我为什么要模仿? 我来自ASP.NET背景,IUSR获得只读权限,应用程序池标识获得任何写入权限。 给予IUSR写入权限通常会打开WebDAV漏洞的大门。 所以我不愿意让PHP像IUSR一样运行。 我找不到很多人问这个问题( 1 | 2 ),所以我觉得我必须要失去一些东西。 有人能为我澄清这个吗?
我希望能够在运行Ubuntu 12.04的开发框中运行多个php版本。 我想要完成的是,当我使用localhost作为域默认使用(让我们说php 5.3.17)。 当我使用域名为php 5.4.7时使用547.localhost。 我见过一些教程,使用fastcgi这个工作,但直到现在我还没有能够得到它的工作。 我看过这些教程: http://dbforch.wordpress.com/2010/05/21/apache2-fastcgi-multiple-php-versions-ubuntulucid-10-04/ http://www.metod.si/multiple-php-versions-with-apache-2-fastcgi-phpfarm-on-ubuntu/ 就我所知,我已经做了所需要的一切。 问题是,PHP根本不运行。 当我去http://localhost/somephpfile.php它只是输出的PHP文件的来源。 对于http://547.localhost/somephpfile.php 。 我会分解我所采取的步骤,希望有人能够发现我错过了什么。 首先,我使用sudo apt-get install lamp-server^ phpmyadmin安装了一个默认灯pipe栈。 在此之后,我有一个运行PHP版本的工作的开发服务器。 然后我用phpfarm创build两个php安装,一个用于5.3.17,一个用于5.4.7。 phpfarm的地方是/etc/php/phpfarm ,所以可执行文件在/etc/php/phpfarm/inst/php-{version}/bin 然后,我启用suaxec和fastcgi的Apache和disabe mod_php与sudo a2enmod fastcgi actions suexec && sudo a2dismod php5 接下来,我编辑了/etc/apache2/mods-enabled/fastcgi.conf来读取: <IfModule mod_fastcgi.c> FastCgiIpcDir /var/lib/apache2/fastcgi FastCgiWrapper /usr/lib/apache2/suexec FastCgiConfig -idle-timeout 110 -killInterval 120 -pass-header HTTP_AUTHORIZATION -autoUpdate ScriptAlias /php-fcgi/ /var/www/cgi-bin/ </IfModule> 然后在/var/www/我创build了一个文件夹cgi-bin,并在这个文件夹中有两个文件,每个php版本如下(我只显示了5.3.17 […]
我已经在一台RHEL5服务器上运行了PHP 5.2.10下的nginx 0.7x + PHP-FPM,但是试图在第二个服务器上的PHP 5.3.3中绑定的PHP-FPM下复制该设置,每次发生GET都会出现许多错误。 FPM启动,并确认fastcgi正在监听9000,但每次我做一个GET,我在nginx日志中看到这个错误: 2010/08/12 23:38:53 [crit] 5019#0: *5 stat() "/home/noisepages/www/" failed (13: Permission denied), client: 24.215.173.141, server: dev.noisepages.com, request: "GET / HTTP/1.1", host: "dev.noisepages.com" 准系统nginx.conf.default至less起作用。 这是我的nginx.conf server { listen 80; server_name dev.noisepages.com; root /home/noisepages/www; index index.html index.htm index.php; access_log logs/dev.access.log; error_log logs/dev.error.log; location / { if (-f $request_filename) { expires 30d; […]
请使用不同的Nginx WSGI接口解释优点/缺点? 请详细解释每种configuration的区别? 哪个configuration应该最好? 如果相关,你现在在跑什么,为什么? 我见过的一些技巧,但请告诉我,如果我错过了任何: mod_wsgi的 uWSGI通过Nginx uWSGI FastCGI + flup 代理另一个WSGI服务器( gevent , gunicorn , 龙卷风 , FAPWS3 )
经过6个小时的debugging – 我放弃了:| 我们在局域网上有一个nginx + php-fpm + mysql,几乎有100个wordpress(由不同的devise人员/开发人员创build和使用,所有工作都在testingwordpres设置上) 我们使用nginx没有任何问题。 今天,突然之间 – nginx开始退出蓝色的“504网关超时”。 我检查了虚拟主机的nginx错误日志… 2010/09/06 21:24:24 [error] 12909#0: *349 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.0.1, server: rahul286.rtcamp.info, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "rahul286.rtcamp.info" 2010/09/06 21:25:11 [error] 12909#0: *349 recv() failed (104: Connection reset by peer) […]
我最近一直在调查Apache和Nginx之间的差异,并对我应该select哪一个感到困惑。 我已经做了一些探索,但两者之间没有明确的比较,我想知道这里的人是否可以就两者之间的分歧发表意见。 我目前的知识让我明白,mod_php比fastcgi更快,更安全,但是在同时连接和内存消耗方面,Apache更糟糕。 我的网站正在使用大量的长时间轮询,但有一个非AJAX的网页基础(即Apache长期轮询顶部)。 我对Apaches内存问题的原始解决scheme是通过node.js发送长轮询,然后让node.js每2秒访问Apache,在这种情况下Apache不会有打开的连接,而是node.js会。 我已经意识到这可能不够好,正在寻找不同的解决scheme。 我仍然对我最初的想法是否有效感兴趣。 那么现代网站哪个更好? Apache还是Nginx? 更新:所有的build议是好的和有效的。 我已经与原来的第二个想法是使用一个完整的Nginx服务器。 我很满意,作为一个专用的服务器,我不能忍受fastcgi的安全问题,并且由于我的长轮询脚本需要用PHP编写,我需要一个能够处理高负载同时连接的服务器,而Apache无论如何也不能这样做我改变了结构,它仍然是饥饿的内存。 我已经标记了Martin F的答案,因为他对我的问题提出了一个清晰而完整的答案,我觉得他应该得到这个评价,但是,这三个答案都是好的和有效的,并且肯定会考虑将反向代理用于我自己的另一个站点因为我刚刚发现Nginx可以在代理中做的非常非常非常酷的事情。 谢谢,
最近有人build议我使用FastCGI和PHP。 现在我进入FastCGI页面阅读,但我不明白它的优点。