From owner-freebsd-questions@FreeBSD.ORG Wed Feb 22 05:13:33 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576EB106566C for ; Wed, 22 Feb 2012 05:13:33 +0000 (UTC) (envelope-from alexus@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id CF7668FC08 for ; Wed, 22 Feb 2012 05:13:32 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so6320024wib.13 for ; Tue, 21 Feb 2012 21:13:31 -0800 (PST) Received-SPF: pass (google.com: domain of alexus@gmail.com designates 10.216.131.234 as permitted sender) client-ip=10.216.131.234; Authentication-Results: mr.google.com; spf=pass (google.com: domain of alexus@gmail.com designates 10.216.131.234 as permitted sender) smtp.mail=alexus@gmail.com; dkim=pass header.i=alexus@gmail.com Received: from mr.google.com ([10.216.131.234]) by 10.216.131.234 with SMTP id m84mr10325376wei.24.1329887611761 (num_hops = 1); Tue, 21 Feb 2012 21:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=bVITBwUdZI+oc7IZIuh9JbF+Keger68c0n2tiNeclKo=; b=tGvqZdzKxJc9ae6tZ7JkwfuEXMvXUzBSbpeiETu9pUm7yfBkGxKMmHmxzR/VFkq6x8 JBGMIWcKfpID7X0QvS5dml7QibHbH1bnjbn3xhC3+25halI/CbSq4N47TJ8sOsncFNxi z1AxKBjV6gIPgGNdhoydSK50MyEl8Gy4D9QRE= MIME-Version: 1.0 Received: by 10.216.131.234 with SMTP id m84mr8465950wei.24.1329887611670; Tue, 21 Feb 2012 21:13:31 -0800 (PST) Received: by 10.216.186.141 with HTTP; Tue, 21 Feb 2012 21:13:31 -0800 (PST) In-Reply-To: References: Date: Wed, 22 Feb 2012 00:13:31 -0500 Message-ID: From: alexus To: nightrecon@hotmail.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: apache22 + php5 (package not ports) ~ spawn-fcgi ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Feb 2012 05:13:33 -0000 thank you for your respond - that's my plan b i'd like to know if i can exercise my plan a first: i already have installed apache22, php5 as package (pkg_add) without having them build through /usr/ports (i know how everyone likes ports around here). i want to see if it's possible to have a link between apache22 and php5 with using packages only (i.e. without /usr/ports) and since mod_php is mia for whatever reason(s) i want to see if fastcgi can be used and PHP-FPM isn't available in packages too (i'm start thinking packages sucks comparing to /usr/ports) basically my last resort (at least that i know of to try) is to go with spawn-fcgi. i dont have alot of requirements but i do need apache22 + php5 to talk to each others and i want to know if it can be done with pkg_add vs /usr/ports On Wed, Feb 22, 2012 at 12:03 AM, Michael Powell w= rote: > alexus wrote: > >> I dont think you really grasping what I was asking.. >> I am aware that I can build from source, yet I'm trying to stay away >> from that route due to a lot of overhead going forward... >> I'm also aware that php5 or actually apache22 doesn't come with >> mod_php as well, and as alternative I'm willing to go spawn-fcgi route >> instead, and this is what I'm interested in. >> I'm looking for some blog/howtos of people already done it on freebsd >> and not just a general fastcgi.com site :) >> So, if anyone have an experience or know a good resources that may be >> useful for me at this point of time, I'd highly appreciate if you can >> post it here. > > > You do not need spawn-fcgi wrt to PHP. I install software by compiling > through the ports system, as it is just so much more maintainable in the > long run. Also, you are more able to select build options which are bette= r > suited to your needs and environment. I have built Apache outside the por= ts > tree in the long-ago past, so I do understand how. It's just there really= is > not a great reason to do so. > > In my case, I utilize the apache-event MPM in conjunction with FastCGI. > Originally I began with mod_fcgi, and it seemed to work well. When I lear= ned > that mod_fastcgi was supposed to work better with PHP-FPM I switched to i= t > when I made the change to PHP-FPM. > > PHP-FPM runs on it's own at boot and has it's own startup scripts. You ca= n > set the options to do this when you build the base PHP port by choosing > WITH_CLI=3Dtrue, WITH_CGI=3Dtrue, =C2=A0WITH_FPM=3Dtrue and you will not = need spawn- > fcgi; PHP-FPM supplies this functionality [e.g 'long-running process'] by > design. Also there is a .conf you can use to adjust your PHP CGI pools in= a > much more granular way than with spawn-fcgi. > > Irregardless of which MPM you run Apache with, the next step is to connec= t > Apache through mod_fastcgi to these running instance(s) of PHP. Here is a= n > example from httpd.conf for this: > > [...] > LoadModule fastcgi_module =C2=A0 =C2=A0 libexec/apache22/mod_fastcgi.so > > [...] > > > Alias /php-cgi /usr/local/www/fastcgi/php-cgi > #FastCGIExternalServer /usr/local/www/fastcgi/php-cgi -flush -host > 127.0.0.1:9000 > FastCGIExternalServer /usr/local/www/fastcgi/php-cgi -flush -socket /tmp/= php- > fm.sock > =C2=A0AddType application/x-httpd-php .php > =C2=A0Action application/x-httpd-php /php-cgi > > =C2=A0 > =C2=A0 =C2=A0 Order deny,allow > =C2=A0 =C2=A0 Deny from all > =C2=A0 > =C2=A0 =C2=A0Order allow,deny > =C2=A0 =C2=A0Allow from all > =C2=A0 > =C2=A0 > > > Notice I use a socket, and this socket is configured in the php-fpm.conf.= The > normal default is to use the TCP loopback. This also is probably not the > best config available, but it supplies my very basic needs. If you are tr= ying > to set up Apache with mod_fastcgi, go with PHP-FPM as your CGI version of > the PHP port build (set in the make config options) and it will be easy. = IMHO > this is a better way to go than spawn-fcgi, especially wrt to PHP > specifically. > > --Mike > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" --=20 http://alexus.org/