emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#33104: closed ([PATCH] services: httpd: Allow usin


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#33104: closed ([PATCH] services: httpd: Allow using it with PHP.)
Date: Sat, 27 Oct 2018 13:17:02 +0000

Your message dated Sat, 27 Oct 2018 14:16:23 +0100
with message-id <address@hidden>
and subject line Re: [bug#33104] [PATCH] services: httpd: Allow using it with 
PHP.
has caused the debbugs.gnu.org bug report #33104,
regarding [PATCH] services: httpd: Allow using it with PHP.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
33104: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33104
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] services: httpd: Allow using it with PHP. Date: Sat, 20 Oct 2018 18:44:03 +0200 User-agent: NeoMutt/20180716
* 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 address@hidden
 Copyright @copyright{} 2018 Mike address@hidden
 Copyright @copyright{} 2018 Pierre-Antoine address@hidden
 Copyright @copyright{} 2018 Gábor address@hidden
+Copyright @copyright{} 2018 Florian address@hidden
 
 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
 
address@hidden {Scheme Variable} %default-httpd-modules
+A default list of @code{httpd-module} objects.
address@hidden defvr
+
 @deffn {Data Type} httpd-config-file
 This data type represents a configuration file for the httpd service.
 
@@ -16603,6 +16608,32 @@ This data type represents a configuration file for the 
httpd service.
 The modules to load. Additional modules can be added here, or loaded by
 additional configuration.
 
+For example, in order to handle requests for PHP files, you can use Apache’s
address@hidden module along with @code{php-fpm-service-type}:
+
address@hidden
+(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 "\
+<FilesMatch \\.php$>
+    SetHandler \"proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/\"
+</FilesMatch>"))))))
+(service php-fpm-service-type
+         (php-fpm-configuration
+          (socket "/var/run/php-fpm.sock")
+          (socket-group "httpd")))
address@hidden 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
 
+            <httpd-module>
+            httpd-module
+            httpd-module?
+            %default-httpd-modules
+
             httpd-service-type
 
             <nginx-configuration>
-- 
2.19.1




--- End Message ---
--- Begin Message --- Subject: Re: [bug#33104] [PATCH] services: httpd: Allow using it with PHP. Date: Sat, 27 Oct 2018 14:16:23 +0100 User-agent: mu4e 1.0; emacs 26.1
Ludovic Courtès <address@hidden> writes:

> Hi Florian!
>
> Florian Pelz <address@hidden> skribis:
>
>> * gnu/services/web.scm (httpd): Make existing httpd-module API public.
>> * doc/guix.texi (Apache HTTP Server): Document its usage with PHP-FPM.
>
> At first sight this LGTM but I’m no expert.  Chris, WDYT?  Please apply
> if it looks good to you!

Hey both,

Thanks for this patch Florian, it looks like a good change to make, and
I've now applied it.

I think when I was writing the httpd service originally, I ended up just
sticking the module loading in the extra configuration, but this looks
like a good way of handling it.

Thanks again,

Chris

Attachment: signature.asc
Description: PGP signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]