Articles of FastCGI的

caching:在多个网站环境中的Nginx上varnish vs fastcgi_cache

我有一个VPS与几个网站的设置。 一些网站是WP网站,其中一些是其他dynamic网站。 我有兴趣添加一种反向代理/caching层。 不过,我不想caching所有的网站… 我看到很多人推荐使用清漆。 我在Varnish中发现的问题是需要80端口并caching所有内容。 当我正在寻找解决scheme或避免caching某些网站的方法时,我发现fastcgi_cache。 显然,你可以直接通过Nginxcaching到文件中,然后静态地提供服务。 我也看到了一些可以从Nginxcaching到memcached的地方,但是我现在还不知道。 无论如何,这里是我的select:1.使用Varnish,并以某种方式调整configuration文件传递基于域名的请求。 2.在Nginx上使用fastcgi_cache。 3.使用三明治。 让Nginx监听端口80,为静态文件提供服务,并将所有php文件发送到另一个端口上的Varnish,并将所有未caching的用户传递给另一个Nginx实例。 你觉得我应该怎么做? 谢谢。

尝试使用FastCGI在Apache上使用Mono运行ASP.NET MVC应用程序

我有一个DreamHost主机帐户,我想使用相同的帐户来运行ASP.NET应用程序。 我有一个应用程序部署在一个子域,一个.htaccess像这样的处理程序: # Define the FastCGI Mono launcher as an Apache handler and let # it manage this web-application (its files and subdirectories) SetHandler monoWrapper Action monoWrapper /home/arienh4/<domain>/cgi-bin/mono.fcgi virtual 我的mono.fcgi是这样设置的: #!/bin/sh #umask 0077 exec >>/home/arienh4/tmp/mono-fcgi.log exec 2>>/home/arienh4/tmp/mono-fcgi.err echo $(date +"[%F %T]") Starting fastcgi-mono-server2 cd / chmod 0700 /home/arienh4/tmp/mono-fcgi.sock echo $$>/home/arienh4/tmp/mono-fcgi.pid # stdin is the socket […]

lighttpd + FastCGI + Mono不能与evhost启用

我已经开始将Windows VPS迁移到linode.com,在nginx和apache上selectlighttpd来托pipe一些build立在asp.net mvc上的网站,而且我坚持认为是“文档根”冲突。 我在Ubuntu 10.04上运行lighttpd 1.4.6,Mono 2.8.2 我已经configurationmod_evhost模式来匹配这个目录结构: /var/webs/country-tld.tld.domain/www /var/webs/country-tld.tld.domain/subdomain 并从请求中删除所有的“www”,redirect到url,并且对于静态内容一切工作正常,但是当加载aspx页面时,我总是得到default.aspx的404错误。 当我将server.document-root设置为任何网站(绕过evhost规则)时,Mono工作正常,按预期为aspx页面提供服务。 其中指出我认为,当evhost被启用时,“MONO_FCGI_ROOT”= server.document-root被混合的其余configuration导致aspx内容的404。 有没有人有这样的环境设置经验? 在使用Apache + mod_mono设置所有内容或者为每个主机使用单独的fastcgi映射之前,我真的希望给lighttpd的configuration优雅和简单一个机会。 这些是我的configuration文件。 /etc/lighttpd/lighttpd.conf: server.modules = ( "mod_access", "mod_alias", "mod_accesslog", "mod_compress", "mod_rewrite", "mod_redirect", "mod_evhost" ) server.document-root = "/var/webs/default/" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" index-file.names = ( "index.html", "index.htm", "default.htm", "default.html" ) accesslog.filename = "/var/log/lighttpd/access.log" url.access-deny = […]

Lighttpd和FastCGI在启动时不会创build/tmp/fcgi.sock?

我在debian 5的机器上运行lighttpd-1.4.19,并尝试使用fastcgi运行web2py。 问题在于,lighttpd不会创build套接字文件/tmp/fcgi.sock。 如果我自己创build文件 touch /tmp/fcgi.sock lighttpd会启动,但会在运行一段时间后抛出这个错误: unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: unix:/tmp/fcgi.sock 我的configuration如下所示: fastcgi.server =( “/handler_web2py.fcgi”=>( “handler_web2py”=>(日志的#name “check-local”=>“禁用”, “socket”=>“/tmp/fcgi.sock”, “空闲超时”=> 20, “max-procs”=> 1 ) ) ) 在Debian 5上运行lighttpd有没有什么已知的问题? 谢谢你的帮助。 我粘贴了整个lighttpdconfiguration: http : //pastie.org/1660646

nginx PHP文件404

我正在使用我的nginx / php-fastcgi安装在PHP文件中找不到404。 我已经尝试了在不同的地方声明根的几个变种,但无法find一个有效的,我怀疑这是与它有关的事情。 这里是我的configuration文件,任何人都可以看到什么可能是错误的/失踪? 我的nginx.conf; worker_processes 1; error_log /opt/local/var/log/nginx/error.log; pid /opt/local/var/run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type text/html; sendfile on; keepalive_timeout 65; passenger_root /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.7; passenger_ruby /opt/local/bin/ruby; server { listen 80; server_name localhost; root /Users/foo/Sites; location / { root /Users/foo/Sites; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location […]

lighttpd和mod_proxy与PHP

我正在尝试使用lighttpd,一些自定义Ruby代理,rails / ramaze(在Thin上运行)和PHP的组合来创build相当复杂的设置。 目前它是这样设置的: 浏览器发出点击lighttpd前端的请求。 lighttpd是用mod_proxy设置的,将这个请求路由到我自定义devise的许多Ruby代理之一。 proxy.balance = "fair" proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 9090 ), ( "host" => "127.0.0.1", "port" => 9091 ) ) ) 该请求被转发到其中一个Ruby进程,然后打开一个新的连接到运行应用程序的许多瘦实例之一。 它使用了一些负载均衡魔术以及一组networking服务器。 瘦实例生成页面,将其发送回代理,代理将该页面发回给lighttpd,由lighttpd将其提供给浏览器。 我的问题是,鉴于上述体系结构,将PHP支持添加到此群集中的最佳方式是什么? PHP需要在Ruby代理之后运行,这样我就可以区分PHP和Ruby请求,并将它们路由到正确的位置,但是我找不到适用于PHP的精简型服务器。 我应该手动启动群集上的php-cgi,然后添加FCGI支持到我的Ruby代理? 还是应该在每台服务器上启动一个新的lighttpd实例来专门生成PHP页面(我觉得这与使用Ruby的瘦模型最接近,但是担心开销和缺乏控制)。 请记住,每个应用程序都需要入侵它自己的* nix帐户,一些应用程序在多个服务器上占用10多个帐户。 我还需要一种方法来正确地限制PHP应用程序使用的服务器资源的数量(也许通过每个* nix acount启动一个或两个php-cgi实例?)。

由CGI绘制的Munin图

我有穆宁工作得很好,但任何时候我尝试做CGI图 – 它只是停止绘图…没有错误的日志,什么都没有。 我按照这里的说明: http ://munin-monitoring.org/wiki/CgiHowto – 它应该工作 – 这是我的munin.conf设置,至less是重要的部分: dbdir /var/lib/munin htmldir /var/www/munin logdir /var/log/munin rundir /var/run/munin tmpldir /etc/munin/templates graph_strategy cgi cgiurl /usr/lib/cgi-bin cgiurl_graph /cgi-bin/munin-cgi-graph 然后主机信息yada yada – graph_strategy cgi和cgrurl在munin.conf中被注释掉 – 这是因为如果我取消注释它们,graphics将停止工作。 再一次,我没有在日志中的错误,只是图像曾经是空白的图像。 注释掉CGI? 一旦munin html再次运行,一切都恢复正常。 我正在运行munin和munin-node的最新版本 – 我试过fastcgi和正常的cgi – 涉及的所有目录的权限都是munin:www-data – 而且我的httpd.conf文件如下所示: ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory /usr/lib/cgi-bin/> AllowOverride None SetHandler fastcgi-script Options ExecCGI […]

使用lighttpd与fastcgi授权者导致问题的video(mod_h264_streaming)

所以我的目标是提供stream媒体video,但只有在authentication后。 由于身份validation可以使用许多方法之一,我正在写一个fastcgi授权人来处理它们。 每个部分(stream媒体,fastcgi授权人)独立工作,但一起事情崩溃。 我在这里设置了一个演示。 我有三个部分:每个部分都有一个图像和一个video。 第一部分是显示公共内容,第二部分是显示私人内容(必须先authentication),第三部分是使用JS包装来pipe理私人内容的显示。 要获得授权,请点击“获取访问权限”。 然后返回到索引页面。 会发生什么是私人video永不加载(虽然私人图像加载好)。 此外,没有错误或访问日志行表示正在加载或甚至请求私人video。 我的lighttpdconfiguration的相关部分 server.modules += ("mod_h264_streaming") server.modules += ("mod_fastcgi") h264-streaming.extensions = ( ".mp4", ".f4v" ) h264-streaming.buffer-seconds = 10 fastcgi.debug = 1 fastcgi.server = ( "/fake_cookie" => ( "fake_cookie" => ( "socket" => "/Users/geoff/manual/lighttpd/build/lighttpd.fake_cookie.fcgi.sock", "bin-path" => "/Users/geoff/manual/lighttpd/build/fcgi/fake_cookie.pl", "check-local" => "disable" )), "/kill_cookie" => ( "kill_cookie" => ( "socket" […]

APC正常运行时间为0,因为快速

我有一个使用Parallels / Plesk的VPS(11.0.9更新#22,最后更新于2012年10月31日03:33 CentOS 6.3(最终)x86_64) 我有apache(CGI / FastCGI)安装和nginx作为反向代理。 一切正常。 我安装了APC进行caching,但问题是运行时间总是为0。 它每15秒左右重启一次。 我到处检查,找不到解决办法。 服务器已启用宽限重启,但每隔6小时,不应影响APC正常运行时间。 在Google中search我发现这可能与Apache相关,使用FCGId而不是FastCGI运行。 Plesk / Apache正在使用这个configuration文件:usr / local / psa / admin / conf / templates / default / service / php_over_fastcgi.php其中内容是: <IfModule mod_fcgid.c> <Files ~ (\.php)> SetHandler fcgid-script FCGIWrapper <?php echo $VAR->server->webserver->apache->phpCgiBin ?> .p$ Options +ExecCGI allow from all </Files> 这里是问题还是其他地方? 我怎样才能解决这个问题与FastCGI一起工作,使APC正常工作。 我忘了说明,即使正常运行时间低于一分钟,APC也做得很不错(92%是命中)。

无法使PHP在Apache和Windows上作为FastCGI工作

我试图运行PHP作为FastCGI没有成功。 我在mod_fcgid页面上创build了一个* .conf文件,但没有包装脚本。 这是我的conf: # php5 as FastCGI executable FcgidMaxRequestsPerProcess 10000 # Uncomment the following line if cgi.fix_pathinfo is set to 1 in # php.ini: # FcgidFixPathinfo 1 <Location "D:/www"> AddHandler fcgid-script .php Options +ExecCGI FcgidWrapper "C:/php/php-cgi.exe" .php # Customize the next two directives for your requirements. Order allow,deny Allow from all </Location> 服务器正常启动,fcgid_module显示为httpd -M […]