Re: PHP and a general problem understanding fastcgi

David Birnbaum <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
On Wed, 13 Jul 2005, Benjamin Podszun wrote:

> Thanks for your comments here. I thought I understand what you mean and tried 
> the following:
>
> FastCgiServer /var/www/default/php/php -user web-default -group web-users 
> -socket default

This should be out of scope of the vhost - but map to the vhost.

So, set up the VHost something like this:

   <VirtualHost 1.2.3.4:80>
     DocumentRoot /var/www/1.2.34
     User blah
     Group blahgrp

     <Location /php/php>
       SetHandler fastcgi-script
     </Location>
     Action php-fastcgi /php/php
   </VirtualHost>

So this sets up FastCGI properly for Dynamic mode, I think (although you 
probably need to enable FastCgiWrapper.  If you want a static server, then you 
put this OUT of scope (because it's server wide):

   FastCgiServer /var/www/1.2.3.4/php/php -user web-default -group web-users

which will create the instance.  You can then multiply these like so:

   FastCgiServer /var/www/blah.com/php/php -user blah -group blahgrp
   FastCgiServer /var/www/foo.com/php/php -user foo -group foogrp

And they will work, as long as php/php is set up as a php-fastcgi action within 
the relevant vhosts (blah.com, foo.com).  If you want only ONE server, then 
change things like so:

   FastCgiServer /var/www/1.2.3.4/php/php -user web-default -group web-users -port 9050
   FastCgiExternalServer /var/www/blah.com/php/php -host localhost:9050
   FastCgiExternalServer /var/www/foo.com/php/php -host localhost:9050

which will have one "real" instance and two "fake" instances that are handled 
internally.

> I'd love to - but right now I can only come up with ways that _don't_ work.. 
> Something like a "Don't try the following" FAQ.. ;-)

Well, we'll work on that  ;)  Dang it, I wrote that FAQ entry a few years ago 
and haven't looked at it since!

David.

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
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.