Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9D7FE200BB1 for ; Thu, 3 Nov 2016 19:05:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9C0A3160AFF; Thu, 3 Nov 2016 18:05:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BA2E8160AE5 for ; Thu, 3 Nov 2016 19:05:12 +0100 (CET) Received: (qmail 62656 invoked by uid 500); 3 Nov 2016 18:05:11 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 62646 invoked by uid 99); 3 Nov 2016 18:05:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Nov 2016 18:05:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C927C18030C for ; Thu, 3 Nov 2016 18:05:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.9 X-Spam-Level: * X-Spam-Status: No, score=1.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=eroi.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id NxWtcCch2bps for ; Thu, 3 Nov 2016 18:05:08 +0000 (UTC) Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A71815F22F for ; Thu, 3 Nov 2016 18:05:07 +0000 (UTC) Received: by mail-pf0-f181.google.com with SMTP id 189so35539979pfz.3 for ; Thu, 03 Nov 2016 11:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eroi.com; s=google; h=from:subject:message-id:date:to:mime-version; bh=d6HvBzx1wb1zrswxpaRPD3ksAtWiQUt3SaRcXme3oFk=; b=lzfWLoQ29DpPIP/bjZ9b6K7zGiSFQvzz30OBuDVwbZfcU5DIAg2Tv74jJODX06aMQc C2WivZ3U6gmlTPNVsXbW2XEXocMvHELbrMw8Jjf6Ub8E2p8F8sHZ8L+jdNNLiggrMX+p DJFEuYI46eh6X+PsKNGAQlIuCs8LsGzZbUhEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:message-id:date:to:mime-version; bh=d6HvBzx1wb1zrswxpaRPD3ksAtWiQUt3SaRcXme3oFk=; b=XPXpNLKQrH7C0EuvS3HTWZ/xRGu77a3yOmy8kYBRnoDgJEUphpc+s3VF1vN3+9Axmh oN8kPRTDVe+iRCrvibmJumzQSqxzpUhndKTLkSvUKpFtJBB+/IVPcgFSfa600LN6P17z W2LWrf4dZGz4hxtXhZY/iLN5d38vFU82fEdFLGyWb+2tvXrNaK77wYKoNfLENeFs56+f GIstxrm1zmrmrEzPFtUe9dbvvLZ3z0QpvPGFVSbDlormMsxmLHK5HkHyNR1DXbwucoXS tGt4B0k6Hpj5YpeH8hpMRRSgD1gBekGtcXjh3Grf1KTfDRTyVaPgcCliqXR7v1xfOlyN fUHg== X-Gm-Message-State: ABUngveSWdriAPCu9wmwmBEpjhftP39SlOjFsixxVj/GE5GteOKJ/CZA/kot2MhYgJIEQllO X-Received: by 10.98.223.25 with SMTP id u25mr18825173pfg.96.1478196302496; Thu, 03 Nov 2016 11:05:02 -0700 (PDT) Received: from [192.168.1.152] (173-164-113-53-Oregon.hfc.comcastbusiness.net. [173.164.113.53]) by smtp.gmail.com with ESMTPSA id jz5sm14336443pad.10.2016.11.03.11.05.00 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Nov 2016 11:05:01 -0700 (PDT) From: Jason Brooks Content-Type: multipart/alternative; boundary="Apple-Mail=_35FBE5E6-682E-4CF5-B5D0-34D16BEC264D" Message-Id: <585E24A2-7534-4D7E-9297-7C86558A47CE@eroi.com> Date: Thu, 3 Nov 2016 11:05:00 -0700 To: users@httpd.apache.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) Subject: [users@httpd] Question about configuring apache to use php via fpm archived-at: Thu, 03 Nov 2016 18:05:13 -0000 --Apple-Mail=_35FBE5E6-682E-4CF5-B5D0-34D16BEC264D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello, There are several sites on configuring apache with php-fpm. Many = don=E2=80=99t work, some appear to be contradictory. =20 Thus far, I found two configurations that work, but I am not sure which = one is more correct. By =E2=80=9Cmore correct=E2=80=9D I mean=20 less convoluted less hidden issues less security problems better performing =E2=80=A6 This is on a ubuntu 16.04 LTS server, running apache 2.4.18, mpm-event, = with php7.0-fpm installed. I do NOT have mod_php installed. For my = test, I am just running the phpinfo() function call. Here are the configuration methods I have found to work: = --------------------------------------------------------------------------= -- 1) using mod_alias, mod_fastcgi, and mod_actions: =20 Require all granted=20 =20 =20 AddHandler php7-fcgi .php=20 Action php7-fcgi /php7-fcgi virtual=20 Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi=20 FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -host = 127.0.0.1:9000 -pass-header Authorization=20 This was found at = https://www.howtoforge.com/tutorial/apache-with-php-fpm-on-ubuntu-16-04/ = = dated last August. it seems hacky: it needs a cgi-bin directory to be configured, = but doesn=E2=80=99t actually put anything in a cgi-bin directory to = execute... = --------------------------------------------------------------------------= -- 2) using mod_proxy, and mod_proxy_fcgi ProxyPassMatch ^/(.*\.php(/.*)?)$ = "fcgi://localhost:9000/var/www/html/$1" enablereuse=3Don This was found at https://wiki.apache.org/httpd/PHP-FPM = dated last July. it seems more elegant, but I don=E2=80=99t know how speedy it = might be. Thank you for your time! =E2=80=94jason Jason Brooks Systems Administrator eROI Performance is Art. =20 m: 505 nw couch #300 w: eroi.com t: 503.290.3105 f: 503.228.4249 fb: fb.com/eROI --Apple-Mail=_35FBE5E6-682E-4CF5-B5D0-34D16BEC264D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hello,

There are several sites on configuring apache with php-fpm. =  Many don=E2=80=99t work, some appear to be contradictory. =  

Thus = far, I found two configurations that work, but I am not sure which one = is more correct.  By =E2=80=9Cmore correct=E2=80=9D I = mean 

less = convoluted
less hidden issues
less security problems
better = performing
=E2=80=A6

This is on a ubuntu 16.04 LTS server, = running apache 2.4.18, mpm-event, with php7.0-fpm installed.  I do = NOT have mod_php installed.  For my test, I am just running the = phpinfo() function call.

Here are the configuration methods I have found to = work:
---------------------------------------------------------------= -------------
1) using mod_alias, mod_fastcgi, and = mod_actions:
<Directory = /usr/lib/cgi-bin> 
= Require all granted 
=  </Directory> 
=  <IfModule mod_fastcgi.c> 
= AddHandler php7-fcgi .php 
= Action php7-fcgi /php7-fcgi virtual 
= Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi 
= FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -host = 127.0.0.1:9000 -pass-header Authorization 
= </IfModule>

it seems = hacky: it needs a cgi-bin directory to be configured, but doesn=E2=80=99t = actually put anything in a cgi-bin directory to execute...

---------------------------------------------------------------= -------------
2) using mod_proxy, and = mod_proxy_fcgi
ProxyPassMatch ^/(.*\.php(/.*)?)$ = "fcgi://localhost:9000/var/www/html/$1" = enablereuse=3Don

This was found at https://wiki.apache.org/httpd/PHP-FPM dated last = July.
it seems more elegant, but I = don=E2=80=99t know how speedy it might be.

Thank you for your time!

=E2=80=94jason



Jason BrooksSystems Administrator
eROIPerformance is Art.
 
m:505 nw couch #300w:eroi.com
t:503.290.3105f:503.228.4249


fb:fb.com/eROI








= --Apple-Mail=_35FBE5E6-682E-4CF5-B5D0-34D16BEC264D--