Re: FastCgiExternalServer Config

Alex Efros <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi!

On Sun, Mar 15, 2009 at 12:36:45AM +0200, rmostert wrote:
> The main two explanations for the filename parameter I found is
> 1)That filename a virtual script, that doesn't need to exist on either the
> local or the external server, basically a variable name so that apache2
> sends all requests for it to the external server.

I'm using it this way. Here is my config:

--- /etc/apache2/modules.d/20_mod_fastcgi.conf
FastCgiExternalServer /var/www/mysite/html/anyname -host 127.0.0.1:1234
---

--- /var/www/mysite/html/.htaccess
RewriteEngine On
RewriteBase /
# the media/ dir and static.html file should be served by apache in usual
# way, without using fastcgi:
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(static.html)$ - [L]
# everything else (any url, even url which point to non-existent file)
# should be served by fastcgi server running on 127.0.0.1:1234
RewriteCond %{REQUEST_URI} !(/anyname)
RewriteRule ^(.*)$ /anyname/$1 [L]
---

To test your configuration you can run this perl oneliner (you may need
to install CGI::Fast module from CPAN first):

$ export FCGI_SOCKET_PATH=127.0.0.1:1234
$ perl -MCGI::Fast=:all -e 'print header,++$i while new CGI::Fast'

You doesn't need to have file '/var/www/mysite/html/anyname', but if it
will exists it doesn't hurt.

-- 
			WBR, Alex.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.