Re: PHP and a general problem understanding fastcgi

Benjamin Podszun <ben-/[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Benjamin Podszun wrote:
> David Birnbaum wrote:
> 
>> On Wed, 13 Jul 2005, Benjamin Podszun wrote:
>>>> 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.
>>>
>>> Okay - I tried to map this instructions to my setup, but I still get 
>>> the error:
>>>
>>> The requested URL /fast-cgi/default/php/test/index.php was not found 
>>> on this server.
>>
>> That's the clue - see below:
>>
>>> My setup:
>>>
>>> General config:
>>>
>>> FastCgiWrapper On
>>> FastCgiIpcDir /tmp/fastcgi
>>> FastCgiServer /var/www/default/php/php -user web-default -group 
>>> web-users -socket default
>>> FastCgiExternalServer /fast-cgi/default/php -user web-default -group 
>>> web-users -socket default
>>>
>>> I want a single default php instance and share that for default 
>>> hosts/applications. I read those lines above as "create a static 
>>> server of '/var/www/default/php/php' with the given user and group 
>>> and connect a virtual application '/fast-cgi/default/php' to this 
>>> instance". Right so far?
>>
>> Not quite - the FastCgi*Server directives are all absolute pathnames, 
>> NOT relative to the DocumentDir.  So, you actually need to change the 
>> FastCgiExternalServer directive to be absolute, which then overlaps to 
>> the RELATIVE path that your Location/Action is.  It's a bit confusing 
>> that the Location/Action is relative, but the Server directives are 
>> absolute.
> 
> Sorry for wasting your time here.
> Uhm, yes - that's really a little bit confusing. Thanks for the 
> explanation though.
> 
>>> In my vhost I'm having this:
>>>
>>> AddHandler php-fastcgi .php
>>> <Location /fast-cgi/default/php>
>>>  SetHandler fastcgi-script
>>> </Location>
>>> Action php-fastcgi /fast-cgi/default/php
>>>
>>> Which I read as "Add a handler called 'php-fastcgi' for files ending 
>>> with '.php', handle all requests to the location 
>>> '/fast-cgi/default/php' as fastcgi script and call 
>>> '/fast-cgi/default/php' for every request of the php-fastcgi 
>>> handler.. Wouldn't that do what I want?
>>
>> Yes, but you haven't actually mapped the relative path 
>> /fast-cgi/default/php to a server....  I'm guessing that you should 
>> change your FastCgiExternalServer to this:
>>
>>   FastCgiExternalServer /var/www/[your docroot]/fast-cgi/default/php 
>> -socket default
> 
> 
> Done. It's now (pasted):
> 
> FastCgiExternalServer /var/www/default/webroot-ssl/fast-cgi/default/php 
> -user web-default -group web-users -socket default
> 
>> Let's see if that fixes it....
> 
> 
> Sorry.. Exactly the same error message.. :-/

Just found the following line in the webserver's error_log:

No such file or directory: FastCGI: stat() of 
"/var/www/default/webroot-ssl/fast-cgi" failed, referer: 
https://my-host-here/test/

Is that anything known?

Thanks in advance,
Ben
___________________________________
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.