From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDuNA-0007fH-8K for guix-patches@gnu.org; Sat, 20 Oct 2018 12:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDuN4-0003k2-98 for guix-patches@gnu.org; Sat, 20 Oct 2018 12:45:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDuN4-0003jj-49 for guix-patches@gnu.org; Sat, 20 Oct 2018 12:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gDuN4-0008Ar-1W for guix-patches@gnu.org; Sat, 20 Oct 2018 12:45:02 -0400 Subject: [bug#33104] [PATCH] services: httpd: Allow using it with PHP. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDuMF-0007b6-0B for guix-patches@gnu.org; Sat, 20 Oct 2018 12:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDuMB-0002PD-QD for guix-patches@gnu.org; Sat, 20 Oct 2018 12:44:10 -0400 Received: from pelzflorian.de ([5.45.111.108]:37986 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDuMB-0002Mo-Fq for guix-patches@gnu.org; Sat, 20 Oct 2018 12:44:07 -0400 Received: from florianbeaglebone.fritz.box (unknown [91.67.78.16]) by mail.pelzflorian.de (Postfix) with ESMTPSA id A2841360077 for ; Sat, 20 Oct 2018 18:44:05 +0200 (CEST) Date: Sat, 20 Oct 2018 18:44:03 +0200 From: Florian Pelz Message-ID: <20181020164401.ylh63egrl4mbz3qb@florianbeaglebone.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33104@debbugs.gnu.org * gnu/services/web.scm (httpd): Make existing httpd-module API public. * doc/guix.texi (Apache HTTP Server): Document its usage with PHP-FPM. --- doc/guix.texi | 31 +++++++++++++++++++++++++++++++ gnu/services/web.scm | 5 +++++ 2 files changed, 36 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index f4f19949f..58c2cd7f5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -50,6 +50,7 @@ Copyright @copyright{} 2018 Oleg Pykhalov@* Copyright @copyright{} 2018 Mike Gerwitz@* Copyright @copyright{} 2018 Pierre-Antoine Rouby@* Copyright @copyright{} 2018 G=C3=A1bor Boskovits@* +Copyright @copyright{} 2018 Florian Pelz@* =20 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -16595,6 +16596,10 @@ within the store, for example @code{(file-append= mod-wsgi @end table @end deffn =20 +@defvr {Scheme Variable} %default-httpd-modules +A default list of @code{httpd-module} objects. +@end defvr + @deffn {Data Type} httpd-config-file This data type represents a configuration file for the httpd service. =20 @@ -16603,6 +16608,32 @@ This data type represents a configuration file f= or the httpd service. The modules to load. Additional modules can be added here, or loaded by additional configuration. =20 +For example, in order to handle requests for PHP files, you can use Apac= he=E2=80=99s +@code{mod_proxy_fcgi} module along with @code{php-fpm-service-type}: + +@example +(service httpd-service-type + (httpd-configuration + (config + (httpd-config-file + (modules (cons* + (httpd-module + (name "proxy_module") + (file "modules/mod_proxy.so")) + (httpd-module + (name "proxy_fcgi_module") + (file "modules/mod_proxy_fcgi.so")) + %default-httpd-modules)) + (extra-config (list "\ + + SetHandler \"proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/\" +")))))) +(service php-fpm-service-type + (php-fpm-configuration + (socket "/var/run/php-fpm.sock") + (socket-group "httpd"))) +@end example + @item @code{server-root} (default: @code{httpd}) The @code{ServerRoot} in the configuration file, defaults to the httpd package. Directives including @code{Include} and @code{LoadModule} are diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 1edb1f4d3..fcf453c24 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -70,6 +70,11 @@ httpd-config-file-user httpd-config-file-group =20 + + httpd-module + httpd-module? + %default-httpd-modules + httpd-service-type =20 --=20 2.19.1