<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: fastcgi code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 17 May 2008 20:41:27 GMT</pubDate>
    <description>DZone Snippets: fastcgi code</description>
    <item>
      <title>Install fcgi gem after installing FastCGI with darwinports</title>
      <link>http://snippets.dzone.com/posts/show/388</link>
      <description>&lt;code&gt;sudo gem install fcgi -- --with-fcgi-dir=/opt/local&lt;/code&gt;</description>
      <pubDate>Thu, 16 Jun 2005 06:16:55 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/388</guid>
      <author>robbevan (Rob Bevan)</author>
    </item>
    <item>
      <title>My lighttpd php-fastcgi config with it's own php.ini</title>
      <link>http://snippets.dzone.com/posts/show/321</link>
      <description>&lt;code&gt;&lt;br /&gt;fastcgi.server = (&lt;br /&gt;                ".php" =&gt;&lt;br /&gt;                    ( "localhost" =&gt;&lt;br /&gt;                        (&lt;br /&gt;                            "socket" =&gt; "/home/jah/tmp/jah-php5-fcgi.socket",&lt;br /&gt;                            "bin-path" =&gt; "/usr/local/www/cgi-bin/php5-fcgi -c /home/jah/etc/php.ini",&lt;br /&gt;                            "bin-environment" =&gt; (&lt;br /&gt;                            "PHP_FCGI_CHILDREN" =&gt; "32",&lt;br /&gt;                            "PHP_FCGI_MAX_REQUESTS" =&gt; "5000"&lt;br /&gt;                                                 )&lt;br /&gt;                        )&lt;br /&gt;                    )&lt;br /&gt;                 )&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 25 May 2005 18:33:15 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/321</guid>
      <author>jason (Jason Hoffman)</author>
    </item>
    <item>
      <title>FastCGI test script</title>
      <link>http://snippets.dzone.com/posts/show/288</link>
      <description>If you're having trouble with FastCGI (as I was), this Perl script can help you see if the problem is at the Apache end or the app end. In my case I'd simply not deleted the old Ruby sessions for my Rails app when switching from CGI to FCGI ;-) This script proved my Apache wasn't broken, at least.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use FCGI;&lt;br /&gt;&lt;br /&gt;$cnt = 0;&lt;br /&gt;&lt;br /&gt;while (FCGI::accept() &gt;= 0)&lt;br /&gt;{&lt;br /&gt;   print ("Content-type: text/html\r\n\r\n");&lt;br /&gt;   print ("&lt;head&gt;\n&lt;title&gt;FastCGI Demo Page (perl)&lt;/title&gt;\n&lt;/head&gt;\n");&lt;br /&gt;   print  ("&lt;h1&gt;FastCGI Demo Page (perl)&lt;/h1&gt;\n");&lt;br /&gt;   print ("This is coming from a FastCGI server.\n&lt;BR&gt;\n");&lt;br /&gt;   print ("Running on &lt;EM&gt;$ENV{USER}&lt;/EM&gt; to &lt;EM&gt;$ENV{REMOTE_HOST}&lt;/EM&gt;\n&lt;BR&gt;\n");&lt;br /&gt;    $cnt++;&lt;br /&gt;   print ("This is connection number $cnt\n");&lt;br /&gt;}&lt;/code&gt;</description>
      <pubDate>Sun, 15 May 2005 13:11:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/288</guid>
      <author>peter (Peter Cooperx)</author>
    </item>
    <item>
      <title>Suexec'ed PHP-FastCGI on Apache2</title>
      <link>http://snippets.dzone.com/posts/show/81</link>
      <description>A PHP cgi binary compiled with fcgi support&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt; /usr/local/www/cgi-bin/php5-fcgi -v&lt;br /&gt;PHP 5.0.3 (cgi-fcgi) (built: Dec 30 2004 22:44:32)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Central config in httpd.conf&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;IfModule mod_fastcgi.c&gt;&lt;br /&gt;FastCgiIpcDir /usr/local/www/fcgi_ipc/tmp&lt;br /&gt;AddHandler fastcgi-script .fcgi&lt;br /&gt;FastCgiSuexec /usr/local/sbin/suexec&lt;br /&gt;FastCgiConfig -singleThreshold 100 -killInterval 300 -autoUpdate -idle-timeout 240 -pass-header HTTP_AUTHORIZATION&lt;br /&gt;&lt;/IfModule&gt;&lt;br /&gt;&lt;Location /php-fastcgi/&gt;&lt;br /&gt;Options ExecCGI        &lt;br /&gt;SetHandler fastcgi-script&lt;br /&gt;&lt;/Location&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In a virtual host&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SuexecUserGroup ${USER} ${GROUP}&lt;br /&gt;ScriptAlias /php-fastcgi/ ${HOME}/php-fastcgi/ &lt;br /&gt;AddType application/x-httpd-fastphp .php&lt;br /&gt;Action application/x-httpd-fastphp /php-fastcgi/php5-fcgi&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And then the ${HOME}/php-fastcgi/php5-fcgi wrapper	&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/bin/sh &lt;br /&gt;PHPRC="/usr/local/etc" &lt;br /&gt;export PHPRC &lt;br /&gt;PHP_FCGI_CHILDREN=8 &lt;br /&gt;export PHP_FCGI_CHILDREN &lt;br /&gt;PHP_FCGI_MAX_REQUESTS=5000 &lt;br /&gt;export PHP_FCGI_MAX_REQUESTS &lt;br /&gt;exec /usr/local/www/cgi-bin/php5-fcgi &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The PHPRC environment sets the directory where php.ini is to be found</description>
      <pubDate>Fri, 08 Apr 2005 19:18:10 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/81</guid>
      <author>jason (Jason Hoffman)</author>
    </item>
  </channel>
</rss>
