Re: Apache, PHP, Suexec, FastCGI

David Birnbaum <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Tim,

Did you read through this:

   http://www.fastcgi.com/docs/faq.html#PHP

which I wrote?  Try it with static servers first, before dynamic.  The key thing 
is to make sure that the path to the server (FastCgiServer) is an absolute, REAL 
path, and the path to the Location is relative to the web server root directory 
which can be confusing.

If you switch to dynamic, make sure you set the config to MaxClassProcs of 1, 
because you don't ever want it to launch more than on parent PHP, since PHP has 
it's own process manager.

David.

-----

On Sun, 11 Dec 2005, tim-/[email protected] wrote:

> Hello all,
>
> I am absolutely at wits end here, trying to figure out what I am doing
> wrong, getting this combination working.  I actually went onto IRC
> tonight, hoping I could find someone and just pay them so much, to
> configure it for me, *laughs*.  As soon as you talk about FastCGI,
> everyone clams up though.
>
> Here is the scenario.
>
> Hsphere (control panel software) webserver, running :
> -Apache 1.3.34-2 ( /hsphere/shared/apache )
> -PHP 4.4.1 (as mod_php, will disable when time comes) (
> /hsphere/shared/apache/php )
> -PHP 4.4.1 installed as CGI to a new directory ( /hsphere/shared/php4 )
>
> FastCGI :
> -mod_fastcgi-SNAP-0404142202.tar.gz (installed as DSO, step 3 on the
> INSTALL doc)
> -fcgi-2.4.0.tar.gz  - installed with the --prefix option of /hsphere/local
>
> I don't know what options Apache was configured with, as it was preinstalled.
>
> I will paste below, the lines for my httpd.conf that pertain, as well as
> the configure line for php I used.
>
> I found the httpd lines I used, on this page :
>
> http://www.trilithium.com/johan/2005/04/apache2-fastcgi/
>
> I have tried many other combinations, other than apparently, the right one
> ;-) I am just having a hard time finding a tutorial, for anything that is
> even close to my needs, or even IRC, where someone can say, hey, this is
> the problem...  and thus I learn.
>
> I am, at the same time as writing this, open to suggestion.  I chose to go
> with this software (FastCGI), because I have heard a lot of people talk,
> mod_php is just not secure -- suphp is slow, PHP as CGI is slow... FastCGI
> is the way to go.  I am after ultimate security for my shared users, so
> any suggestions would be greatly appreciated.
>
> To follow up with testing I have done with the configuration as is, if I
> exec '/hsphere/shared/php4/bin/php -b 127.0.0.1:10000', it waits for my
> commands, and I can then hit CTRL+D, and it actually parses, just fine.
> executing the same line with a & sign, results in a termination (it doesnt
> stay running as a daemon).
>
> Looking in the error logs for apache, I can see right now :
>
> [Sun Dec 11 19:53:28 2005] [error] [client 209.152.67.6] FastCGI: "ExecCGI
> Option" is off in this directory:
> /fastcgi-bin/php4.fcgi/php-bin/phpinfo.php
>
> Which is odd, because I have it set for the directory that is mentioned
> below (that FastCGI is calling).  I also tried using the full path
> /fastcgi-bin/php4.fcgi/php-bin/ for a directory command in apache, but did
> not change.
>
> I have in some other versions of tutorials, gotten the php to echo to my
> browser, but that is it.
>
> If I run '/hsphere/shared/php4/bin/php -v', I get this :
>
> PHP 4.4.1 (cgi) (built: Nov 19 2005 00:07:46)
> Copyright (c) 1997-2004 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
>
> The php.ini file referenced in the php4.cgi file below, is the system
> default.  I had not gotten anything yet to work, so I had not yet worked
> on doing seperate php.ini files.
>
> Im not sure what other info might pertain, but hopefully someone that
> reads this will have some good insight into just what it is, I am doing
> wrong ...
>
> I thank you all in advance.
>
> Tim
>
>
>
> php4.fcgi (chown somename:somename, chmod 755)
> +++++
> #!/bin/sh
>
> PHPRC="/usr/local/lib"
> export PHPRC
> PHP_FCGI_CHILDREN=4
> export PHP_FCGI_CHILDREN
> exec /hsphere/shared/php4/bin/php
>
>
> httpd.conf (the virtual host section of one user, testing)
> +++++
> FastCgiWrapper  /hsphere/shared/apache/bin/suexec
> FastCgiIpcDir   pipes
> FastCgiConfig   -singleThreshold 1 -pass-header HTTP_AUTHORIZATION
>
> <VirtualHost XX.XX.XXX.XXX:80>
> ServerAdmin  webmaster-9IKiO1iGCm/[email protected]
> DocumentRoot /hsphere/local/home/username/domain.com
> ServerName   domain.com
>
> User         somename
> Group        somename
>
> ################################################
> <IfModule mod_fastcgi.c>
>
>  <Directory /fastcgi-bin>
>   Options ExecCGI
>  </Directory>
>
>    AddHandler  fastcgi-script              .fcgi .fcg .fpl
>
>    Action      application/x-httpd-php4    /fastcgi-bin/php4.fcgi
>    Action      application/x-httpd-php5    /fastcgi-bin/php5.fcgi
>
>    AddType     application/x-httpd-php5    .php5
>    AddType     application/x-httpd-php4    .php .php4
>
> </IfModule>
> #############################################
>
>
> PHP compile :
> +++++
> ./configure --prefix=/hsphere/shared/php4 \
>        --with-zlib-dir \
>        --with-jpeg-dir \
>        --with-png-dir \
>        --with-gd \
> 	--enable-calendar \
> 	--with-mcrypt \
> 	--with-pear \
> 	--with-curl \
> 	--enable-magic-quotes \
>        --with-mysql=/usr \
>        --with-gettext \
>        --disable-debug \
>        --enable-versioning \
>        --enable-sockets \
>        --enable-track-vars \
>        --enable-ftp \
> 	--enable-fastcgi
> make;make install
>
> ___________________________________
> fastcgi-developers mailing list
> http://fastcgi.com/fastcgi-developers/
>

___________________________________
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.