From unknown Sun Sep 14 00:11:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#29741 <29741@debbugs.gnu.org> To: bug#29741 <29741@debbugs.gnu.org> Subject: Status: [PATCH] gnu: services: web: Add service for apache-httpd. Reply-To: bug#29741 <29741@debbugs.gnu.org> Date: Sun, 14 Sep 2025 07:11:52 +0000 retitle 29741 [PATCH] gnu: services: web: Add service for apache-httpd. reassign 29741 guix-patches submitter 29741 Christopher Baines severity 29741 normal tag 29741 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 15:12:46 2017 Received: (at submit) by debbugs.gnu.org; 16 Dec 2017 20:12:46 +0000 Received: from localhost ([127.0.0.1]:37687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQIpC-00021c-2Q for submit@debbugs.gnu.org; Sat, 16 Dec 2017 15:12:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQIpA-00021N-2s for submit@debbugs.gnu.org; Sat, 16 Dec 2017 15:12:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQIp4-0001wu-9d for submit@debbugs.gnu.org; Sat, 16 Dec 2017 15:12:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eQIp4-0001wm-6P for submit@debbugs.gnu.org; Sat, 16 Dec 2017 15:12:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQIp2-0005Ig-PH for guix-patches@gnu.org; Sat, 16 Dec 2017 15:12:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQIox-0001pe-Px for guix-patches@gnu.org; Sat, 16 Dec 2017 15:12:36 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:41192 helo=mira.cbaines.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQIox-0001og-JR for guix-patches@gnu.org; Sat, 16 Dec 2017 15:12:31 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id E1AE513E945; Sat, 16 Dec 2017 20:12:30 +0000 (GMT) Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id BE08713E944 for ; Sat, 16 Dec 2017 20:12:30 +0000 (GMT) Received: from phact (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id e9a132c2 for ; Sat, 16 Dec 2017 20:12:30 +0000 (UTC) User-agent: mu4e 0.9.18; emacs 25.3.1 From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] gnu: services: web: Add service for apache-httpd. Date: Sat, 16 Dec 2017 20:12:30 +0000 Message-ID: <87efnuph3l.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) I've got as far as writing the service type, and a simple system test. I've also managed to deploy this with mod_wsgi (which isn't packaged for Guix yet), which involved extending the service and adding some virtualhosts. There isn't any documentation yet, and I'm not very sure of the way the configuration is organised. In particular: - There is a record type for modules, which are handled specifically handled in the configuration file. I guess this might be helpful if you want to remove modules, but I'm not sure if this is useful. - There is some default extra configuration, which is related to the mime_module, which makes me wonder if there should be something relating these two things. Christopher Baines (2): gnu: tests: web: Generalise the test data for the nginx test. gnu: services: web: Add service for apache-httpd. gnu/services/web.scm | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++- gnu/tests/web.scm | 90 ++++++++++++++++++-- 2 files changed, 311 insertions(+), 6 deletions(-) From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 15:17:04 2017 Received: (at 29741) by debbugs.gnu.org; 16 Dec 2017 20:17:05 +0000 Received: from localhost ([127.0.0.1]:37694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQItM-00028c-L7 for submit@debbugs.gnu.org; Sat, 16 Dec 2017 15:17:04 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:35796 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQItK-00028P-HN for 29741@debbugs.gnu.org; Sat, 16 Dec 2017 15:17:03 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 52C6013E944; Sat, 16 Dec 2017 20:17:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 1E44413E944 for <29741@debbugs.gnu.org>; Sat, 16 Dec 2017 20:17:01 +0000 (GMT) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id a9efb0b9 for <29741@debbugs.gnu.org>; Sat, 16 Dec 2017 20:17:00 +0000 (UTC) From: Christopher Baines To: 29741@debbugs.gnu.org Subject: [PATCH 1/2] gnu: tests: web: Generalise the test data for the nginx test. Date: Sat, 16 Dec 2017 20:16:59 +0000 Message-Id: <20171216201700.23564-1-mail@cbaines.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) So that it can also be used for other web servers. * gnu/tests/web.scm (%index.html-contents): Change nginx to guix. (%make-http-root): Move the index.html file from /srv to /srv/http. (%nginx-servers): Remove the setting of root. --- gnu/tests/web.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index e975cb830..b84f072ac 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -32,21 +32,21 @@ %test-php-fpm)) (define %index.html-contents - ;; Contents of the /index.html file served by nginx. - "Hello, nginx!") + ;; Contents of the /index.html file served by apache-httpd. + "Hello, guix!") (define %make-http-root ;; Create our server root in /srv. #~(begin (mkdir "/srv") - (call-with-output-file "/srv/index.html" + (mkdir "/srv/http") + (call-with-output-file "/srv/http/index.html" (lambda (port) (display #$%index.html-contents port))))) (define %nginx-servers ;; Server blocks. (list (nginx-server-configuration - (root "/srv") (http-port 8042)))) (define %nginx-os -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 15:17:18 2017 Received: (at 29741) by debbugs.gnu.org; 16 Dec 2017 20:17:18 +0000 Received: from localhost ([127.0.0.1]:37696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQItM-00028e-Rm for submit@debbugs.gnu.org; Sat, 16 Dec 2017 15:17:18 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:35794 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQItK-00028J-Ef for 29741@debbugs.gnu.org; Sat, 16 Dec 2017 15:17:03 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id BB6EF13E946; Sat, 16 Dec 2017 20:17:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 3279213E945 for <29741@debbugs.gnu.org>; Sat, 16 Dec 2017 20:17:01 +0000 (GMT) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 94693c66 for <29741@debbugs.gnu.org>; Sat, 16 Dec 2017 20:17:00 +0000 (UTC) From: Christopher Baines To: 29741@debbugs.gnu.org Subject: [PATCH 2/2] gnu: services: web: Add service for apache-httpd. Date: Sat, 16 Dec 2017 20:17:00 +0000 Message-Id: <20171216201700.23564-2-mail@cbaines.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171216201700.23564-1-mail@cbaines.net> References: <20171216201700.23564-1-mail@cbaines.net> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/services/web.scm (, , ): New record types. (%default-apache-httpd-modules, %apache-httpd-accounts, apache-httpd-service-type): New variables. (apache-httpd-shepherd-services, apache-httpd-activation, apache-httpd-process-extensions): New procedures. * gnu/tests/web.scm (run-apache-httpd-test): New procedure. (%apache-httpd-os, %tests-apache-httpd): New variables. --- gnu/services/web.scm | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++- gnu/tests/web.scm | 82 ++++++++++++++++++- 2 files changed, 307 insertions(+), 2 deletions(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 582cf535c..8bfa1bc9b 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -33,8 +33,36 @@ #:use-module ((guix utils) #:select (version-major)) #:use-module ((guix packages) #:select (package-version)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) #:use-module (ice-9 match) - #:export ( + #:export ( + apache-httpd-configuration + apache-httpd-configuration? + apache-httpd-configuration-package + apache-httpd-configuration-pid-file + apache-httpd-configuration-config + + + apache-httpd-virtualhost + apache-httpd-virtualhost? + apache-httpd-virtualhost-addresses-and-ports + apache-httpd-virtualhost-contents + + + apache-httpd-config-file + apache-httpd-config-file? + apache-httpd-config-file-load-modules + apache-httpd-config-file-server-root + apache-httpd-config-file-server-name + apache-httpd-config-file-listen + apache-httpd-config-file-pid-file + apache-httpd-config-file-error-log + apache-httpd-config-file-user + apache-httpd-config-file-group + + apache-httpd-service-type + + nginx-configuration nginx-configuration? nginx-configuartion-nginx @@ -132,6 +160,203 @@ ;;; ;;; Code: +(define-record-type* + apache-httpd-load-module make-apache-httpd-load-module + apache-httpd-load-module? + (name apache-httpd-load-module-name) + (file apache-httpd-load-module-file)) + +(define %default-apache-httpd-modules + (map (match-lambda + ((name file) + (apache-httpd-load-module + (name name) + (file file)))) + '(("authn_file_module" "modules/mod_authn_file.so") + ("authn_core_module" "modules/mod_authn_core.so") + ("authz_host_module" "modules/mod_authz_host.so") + ("authz_groupfile_module" "modules/mod_authz_groupfile.so") + ("authz_user_module" "modules/mod_authz_user.so") + ("authz_core_module" "modules/mod_authz_core.so") + ("access_compat_module" "modules/mod_access_compat.so") + ("auth_basic_module" "modules/mod_auth_basic.so") + ("reqtimeout_module" "modules/mod_reqtimeout.so") + ("filter_module" "modules/mod_filter.so") + ("mime_module" "modules/mod_mime.so") + ("log_config_module" "modules/mod_log_config.so") + ("env_module" "modules/mod_env.so") + ("headers_module" "modules/mod_headers.so") + ("setenvif_module" "modules/mod_setenvif.so") + ("version_module" "modules/mod_version.so") + ("unixd_module" "modules/mod_unixd.so") + ("status_module" "modules/mod_status.so") + ("autoindex_module" "modules/mod_autoindex.so") + ("dir_module" "modules/mod_dir.so") + ("alias_module" "modules/mod_alias.so")))) + +(define-record-type* + apache-httpd-config-file make-apache-httpd-config-file + apache-httpd-config-file? + (load-modules apache-httpd-config-file-load-modules + (default %default-apache-httpd-modules)) + (server-root apache-httpd-config-file-server-root + (default httpd)) + (server-name apache-httpd-config-file-server-name + (default #f)) + (document-root apache-httpd-config-file-document-root + (default "/srv/http")) + (listen apache-httpd-config-file-listen + (default '("80"))) + (pid-file apache-httpd-config-file-pid-file + (default "/var/run/apache-httpd")) + (error-log apache-httpd-config-file-error-log + (default "/var/log/apache-httpd/error_log")) + (user apache-httpd-config-file-user + (default "apache-httpd")) + (group apache-httpd-config-file-group + (default "apache-httpd")) + (extra-config apache-httpd-config-file-extra-config + (default + `("TypesConfig " ,(file-append httpd "/etc/httpd/mime.types") "\n")))) + +(define-gexp-compiler (apache-httpd-config-file-compiler + (file ) system target) + (match file + (($ load-modules server-root server-name + document-root listen pid-file error-log + user group extra-config) + (gexp->derivation + "httpd.conf" + #~(call-with-output-file (ungexp output "out") + (lambda (port) + (display + (string-append + (ungexp-splicing + `(,@(append-map + (match-lambda + (($ name module) + `("LoadModule " ,name " " ,module "\n"))) + load-modules) + ,@`("ServerRoot " ,server-root "\n") + ,@(if server-name + `("ServerName " ,server-name "\n") + '()) + ,@`("DocumentRoot " ,document-root "\n") + ,@(append-map + (lambda (listen-value) + `("Listen " ,listen-value "\n")) + listen) + ,@(if pid-file + `("Pidfile " ,pid-file "\n") + '()) + ,@(if error-log + `("ErrorLog " ,error-log "\n") + '()) + ,@(if user + `("User " ,user "\n") + '()) + ,@(if group + `("Group " ,group "\n") + '()) + "\n\n" + ,@extra-config))) + port))) + #:local-build? #t)))) + +(define-record-type + (apache-httpd-virtualhost addresses-and-ports contents) + apache-httpd-virtualhost? + (addresses-and-ports apache-httpd-virtualhost-addresses-and-ports) + (contents apache-httpd-virtualhost-contents)) + +(define-record-type* + apache-httpd-configuration make-apache-httpd-configuration + apache-httpd-configuration? + (package apache-httpd-configuration-package + (default httpd)) + (pid-file apache-httpd-configuration-pid-file + (default "/var/run/apache-httpd")) + (config apache-httpd-configuration-config + (default (apache-httpd-config-file)))) + +(define %apache-httpd-accounts + (list (user-group (name "apache-httpd") (system? #t)) + (user-account + (name "apache-httpd") + (group "apache-httpd") + (system? #t) + (comment "Apache HTTPD server user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define apache-httpd-shepherd-services + (match-lambda + (($ package pid-file config) + (list (shepherd-service + (provision '(apache-httpd)) + (documentation "The Apache HTTP Server") + (requirement '(networking)) + (start #~(make-forkexec-constructor + `(#$(file-append package "/bin/httpd") + #$@(if config + (list "-f" config) + '())) + #:pid-file #$pid-file)) + (stop #~(make-kill-destructor))))))) + +(define apache-httpd-activation + (match-lambda + (($ package pid-file config) + (match-record + config + + (error-log document-root) + #~(begin + (use-modules (guix build utils)) + + (mkdir-p #$(dirname error-log)) + (mkdir-p #$document-root)))))) + +(define (apache-httpd-process-extensions original-config extension-configs) + (let ((config (apache-httpd-configuration-config + original-config))) + (if (apache-httpd-config-file? config) + (apache-httpd-configuration + (inherit original-config) + (config + (apache-httpd-config-file + (inherit config) + (extra-config + (append (apache-httpd-config-file-extra-config config) + (append-map + (match-lambda + (($ + addresses-and-ports + contents) + `(,(string-append + "\n") + ,@contents + "\n\n")) + ((? string? x) + `("\n" ,x "\n")) + ((? list? x) + `("\n" ,@x "\n"))) + extension-configs))))))))) + +(define apache-httpd-service-type + (service-type (name 'apache-httpd) + (extensions + (list (service-extension shepherd-root-service-type + apache-httpd-shepherd-services) + (service-extension activation-service-type + apache-httpd-activation) + (service-extension account-service-type + (const %apache-httpd-accounts)))) + (compose concatenate) + (extend apache-httpd-process-extensions) + (default-value + (apache-httpd-configuration)))) + (define-record-type* nginx-server-configuration make-nginx-server-configuration nginx-server-configuration? diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index b84f072ac..1f4ab697c 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -28,7 +28,8 @@ #:use-module (gnu services networking) #:use-module (guix gexp) #:use-module (guix store) - #:export (%test-nginx + #:export (%test-apache-httpd + %test-nginx %test-php-fpm)) (define %index.html-contents @@ -44,6 +45,85 @@ (lambda (port) (display #$%index.html-contents port))))) +(define %apache-httpd-os + ;; Operating system under test. + (simple-operating-system + (dhcp-client-service) + (service apache-httpd-service-type + (apache-httpd-configuration + (config (apache-httpd-config-file + (listen '("8080")))))) + (simple-service 'make-http-root activation-service-type + %make-http-root))) + +(define* (run-apache-httpd-test #:optional (http-port 8080)) + "Run tests in %APACHE-HTTPD-OS, which has apache-httpd running and listening on +HTTP-PORT." + (define os + (marionette-operating-system + %apache-httpd-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings `((,http-port . 8080))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "apache-httpd") + + ;; Wait for apache-httpd to be up and running. + (test-assert "service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'apache-httpd) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((pid) (number? pid)))))) + marionette)) + + ;; Retrieve the index.html file we put in /srv. + (test-equal "http-get" + '(200 #$%index.html-contents) + (let-values (((response text) + (http-get "http://localhost:8080/index.html" + #:decode-body? #t))) + (list (response-code response) text))) + + ;; There should be a log file in here. + (test-assert "log file" + (marionette-eval + '(file-exists? "/var/log/apache-httpd/error_log") + marionette)) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "apache-httpd-test" test)) + +(define %test-apache-httpd + (system-test + (name "apache-httpd") + (description "Connect to a running APACHE-HTTPD server.") + (value (run-apache-httpd-test)))) + (define %nginx-servers ;; Server blocks. (list (nginx-server-configuration -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 18 05:02:22 2017 Received: (at 29741) by debbugs.gnu.org; 18 Dec 2017 10:02:22 +0000 Received: from localhost ([127.0.0.1]:39684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQsFa-0000xN-BG for submit@debbugs.gnu.org; Mon, 18 Dec 2017 05:02:22 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:37071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQsFY-0000xF-FH for 29741@debbugs.gnu.org; Mon, 18 Dec 2017 05:02:20 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8D2E9F494; Mon, 18 Dec 2017 11:02:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1KnzcCS0v29y; Mon, 18 Dec 2017 11:02:22 +0100 (CET) Received: from ribbon (unknown [193.50.110.155]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DD337E04D; Mon, 18 Dec 2017 11:02:21 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Christopher Baines Subject: Re: [bug#29741] [PATCH 1/2] gnu: tests: web: Generalise the test data for the nginx test. References: <20171216201700.23564-1-mail@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 Frimaire an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 18 Dec 2017 11:02:17 +0100 In-Reply-To: <20171216201700.23564-1-mail@cbaines.net> (Christopher Baines's message of "Sat, 16 Dec 2017 20:16:59 +0000") Message-ID: <878te0uzfa.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29741 Cc: 29741@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Christopher Baines skribis: > So that it can also be used for other web servers. > > * gnu/tests/web.scm (%index.html-contents): Change nginx to guix. > (%make-http-root): Move the index.html file from /srv to /srv/http. > (%nginx-servers): Remove the setting of root. OK! From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 18 05:10:08 2017 Received: (at 29741) by debbugs.gnu.org; 18 Dec 2017 10:10:08 +0000 Received: from localhost ([127.0.0.1]:39688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQsN5-00017m-4z for submit@debbugs.gnu.org; Mon, 18 Dec 2017 05:10:07 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:37099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQsN2-00017e-Nw for 29741@debbugs.gnu.org; Mon, 18 Dec 2017 05:10:05 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C005C10191; Mon, 18 Dec 2017 11:10:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JfuvOPg2JRc4; Mon, 18 Dec 2017 11:10:07 +0100 (CET) Received: from ribbon (unknown [193.50.110.155]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D76FEF7E5; Mon, 18 Dec 2017 11:10:06 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Christopher Baines Subject: Re: [bug#29741] [PATCH 2/2] gnu: services: web: Add service for apache-httpd. References: <20171216201700.23564-1-mail@cbaines.net> <20171216201700.23564-2-mail@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 Frimaire an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 18 Dec 2017 11:10:02 +0100 In-Reply-To: <20171216201700.23564-2-mail@cbaines.net> (Christopher Baines's message of "Sat, 16 Dec 2017 20:17:00 +0000") Message-ID: <87zi6gtkhx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29741 Cc: 29741@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, Christopher Baines skribis: > * gnu/services/web.scm (, > , > ): New record types. > (%default-apache-httpd-modules, %apache-httpd-accounts, > apache-httpd-service-type): New variables. > (apache-httpd-shepherd-services, apache-httpd-activation, > apache-httpd-process-extensions): New procedures. > * gnu/tests/web.scm (run-apache-httpd-test): New procedure. > (%apache-httpd-os, %tests-apache-httpd): New variables. Nice! Documentation will be welcome. :-) > + #:export ( > + apache-httpd-configuration > + apache-httpd-configuration? > + apache-httpd-configuration-package > + apache-httpd-configuration-pid-file > + apache-httpd-configuration-config In this context I think =E2=80=98httpd-=E2=80=99 would be good enough as a = prefix. > +(define %default-apache-httpd-modules > + (map (match-lambda > + ((name file) > + (apache-httpd-load-module > + (name name) > + (file file)))) > + '(("authn_file_module" "modules/mod_authn_file.so") > + ("authn_core_module" "modules/mod_authn_core.so") > + ("authz_host_module" "modules/mod_authz_host.so") I think having this list here is the right approach. However could you write where it comes from? I guess it=E2=80=99s equal to the current defau= lt in httpd, right? How often do you expect this to be updated? > +(define-record-type* > + apache-httpd-config-file make-apache-httpd-config-file > + apache-httpd-config-file? > + (load-modules apache-httpd-config-file-load-modules > + (default %default-apache-httpd-modules)) Or =E2=80=9Cloaded-modules=E2=80=9D or just =E2=80=9Cmodules=E2=80=9D? > +(define* (run-apache-httpd-test #:optional (http-port 8080)) > + "Run tests in %APACHE-HTTPD-OS, which has apache-httpd running and lis= tening on > +HTTP-PORT." I wonder if we could abstract =E2=80=98run-nginx-test=E2=80=99 just enough = so it can be used for both. It=E2=80=99d need to take a service name, log file, and PID= file as arguments. Otherwise LGTM, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 19 03:03:21 2017 Received: (at 29741) by debbugs.gnu.org; 19 Dec 2017 08:03:21 +0000 Received: from localhost ([127.0.0.1]:41131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRCrw-0007ha-Q8 for submit@debbugs.gnu.org; Tue, 19 Dec 2017 03:03:21 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:38106 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRCru-0007hS-M9 for 29741@debbugs.gnu.org; Tue, 19 Dec 2017 03:03:19 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id E09D513E99A; Tue, 19 Dec 2017 08:03:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id DEC2313E999; Tue, 19 Dec 2017 08:03:16 +0000 (GMT) Received: from phact (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 014abdb8; Tue, 19 Dec 2017 08:03:16 +0000 (UTC) References: <20171216201700.23564-1-mail@cbaines.net> <20171216201700.23564-2-mail@cbaines.net> <87zi6gtkhx.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#29741] [PATCH 2/2] gnu: services: web: Add service for apache-httpd. In-reply-to: <87zi6gtkhx.fsf@gnu.org> Date: Tue, 19 Dec 2017 08:03:13 +0000 Message-ID: <87vah3rvpa.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741 Cc: 29741@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: >> + #:export ( >> + apache-httpd-configuration >> + apache-httpd-configuration? >> + apache-httpd-configuration-package >> + apache-httpd-configuration-pid-file >> + apache-httpd-configuration-config > > In this context I think =E2=80=98httpd-=E2=80=99 would be good enough as = a prefix. Ok. >> +(define %default-apache-httpd-modules >> + (map (match-lambda >> + ((name file) >> + (apache-httpd-load-module >> + (name name) >> + (file file)))) >> + '(("authn_file_module" "modules/mod_authn_file.so") >> + ("authn_core_module" "modules/mod_authn_core.so") >> + ("authz_host_module" "modules/mod_authz_host.so") > > I think having this list here is the right approach. However could you > write where it comes from? I guess it=E2=80=99s equal to the current def= ault in > httpd, right? Yeah, I think I copied the configuration from the httpd.conf file in the httpd package. > How often do you expect this to be updated? I'm not sure, but probably infrequently. >> +(define-record-type* >> + apache-httpd-config-file make-apache-httpd-config-file >> + apache-httpd-config-file? >> + (load-modules apache-httpd-config-file-load-modules >> + (default %default-apache-httpd-modules)) > > Or =E2=80=9Cloaded-modules=E2=80=9D or just =E2=80=9Cmodules=E2=80=9D? Yeah, I'll look at changing this to modules. >> +(define* (run-apache-httpd-test #:optional (http-port 8080)) >> + "Run tests in %APACHE-HTTPD-OS, which has apache-httpd running and li= stening on >> +HTTP-PORT." > > I wonder if we could abstract =E2=80=98run-nginx-test=E2=80=99 just enoug= h so it can be > used for both. It=E2=80=99d need to take a service name, log file, and P= ID file > as arguments. That sounds good, I'll take a look. > Otherwise LGTM, thanks! Thanks for reviewing :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlo4x8FfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfFfRAAiXw/EVbp6E4oipE1AMJJkATFTbBSJ51B3SFu61IeEvk2wdXwgmhpLP4m jFFHFZipCzRkrfrnJMcGmSf/GUAKUsS5Uh8B2T2U2avdRjYci4SZNLhUmysfDoQE 8QdiKSrj6saqQA/s9ptB5wr6EOUY3dOxC0v/ALk5xz/SFUgobHZ+Io1d+v0QK0FI zfbySQgz4rg9mPmNvWcy/gunqRUopUexQgIXycxlLMyjbT4s++DTw+dEznOSvvl8 Hxc08lSH512KoD1/7tmbsP8c1Ule0TtzzMByPUmYxsZtgyN07S51Lypaeu8sP1Im BDchR7n9lFP3ks6fEDcBy+tXQPHvfmOfq+QwLpX0Vl337VB6AJoZSX5sLGTuJMSn NdpsNAENachAZ9X54NWbzXETG0URngdhS2Ct+5XbKRqgrbNP+KTJz9z/9+rNEW7H EyNtqujHpwepHyD/1N8jBn9ZbMUDVCkLj0CyA0npIuraMVQXArvBS4VvbMQ4ixyL gqolP5fNWdhL4VeNiTtNsd+uYMQiAXRRKfvpZ3v41/s00AiA0mS4Dfe5vJPfY/Ks VgxCcsxCWoP1RYz/8kLBsaztBw8+/ds0mrmUGTHxWQFxlirHv+yEQs4Nwi1LWMVK QXNa039zkdL8lsptn6Sbsv9aM5e/kTLhAQMOpj75U/facnWWSLs= =l65U -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 24 13:02:02 2017 Received: (at 29741) by debbugs.gnu.org; 24 Dec 2017 18:02:02 +0000 Received: from localhost ([127.0.0.1]:50873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTAb3-0004QB-TK for submit@debbugs.gnu.org; Sun, 24 Dec 2017 13:02:02 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:42910 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTAb0-0004Pw-S5 for 29741@debbugs.gnu.org; Sun, 24 Dec 2017 13:01:59 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id E844013EA1B; Sun, 24 Dec 2017 18:01:57 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (82.38.6.51.dyn.plus.net [51.6.38.82]) by mira.cbaines.net (Postfix) with ESMTPSA id A480213EA19 for <29741@debbugs.gnu.org>; Sun, 24 Dec 2017 18:01:57 +0000 (GMT) Received: from phact.lan (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 9ef366d9 for <29741@debbugs.gnu.org>; Sun, 24 Dec 2017 18:01:57 +0000 (UTC) From: Christopher Baines To: 29741@debbugs.gnu.org Subject: [PATCH 1/2] gnu: tests: web: Generalise the nginx test. Date: Sun, 24 Dec 2017 18:01:56 +0000 Message-Id: <20171224180157.21873-1-mail@cbaines.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: <87zi6gtkhx.fsf@gnu.org> References: <87zi6gtkhx.fsf@gnu.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) So that it can also be used for other web servers. * gnu/tests/web.scm (%index.html-contents): Change nginx to guix. (%make-http-root): Move the index.html file from /srv to /srv/http. (%nginx-servers): Remove the setting of root. (run-nginx-test, run-webserver-test): Rename run-nginx-test to run-webserver-test and generalise its behaviour (%test-nginx): Change to use run-webserver-test, rather than run-nginx-test. --- gnu/tests/web.scm | 97 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 336f25b3c..5595e9ddf 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -33,47 +33,33 @@ %test-php-fpm)) (define %index.html-contents - ;; Contents of the /index.html file served by nginx. - "Hello, nginx!") + ;; Contents of the /index.html file. + "Hello, guix!") (define %make-http-root ;; Create our server root in /srv. #~(begin (mkdir "/srv") - (call-with-output-file "/srv/index.html" + (mkdir "/srv/http") + (call-with-output-file "/srv/http/index.html" (lambda (port) (display #$%index.html-contents port))))) -(define %nginx-servers - ;; Server blocks. - (list (nginx-server-configuration - (root "/srv") - (listen '("8042" "443 ssl"))))) - -(define %nginx-os - ;; Operating system under test. - (simple-operating-system - (dhcp-client-service) - (service nginx-service-type - (nginx-configuration - (log-directory "/var/log/nginx") - (server-blocks %nginx-servers))) - (simple-service 'make-http-root activation-service-type - %make-http-root))) - -(define* (run-nginx-test #:optional (http-port 8042)) +(define* (run-webserver-test name test-os #:key (log-file #f) (http-port 8080)) "Run tests in %NGINX-OS, which has nginx running and listening on HTTP-PORT." (define os (marionette-operating-system - %nginx-os + test-os #:imported-modules '((gnu services herd) (guix combinators)))) + (define forwarded-port 8080) + (define vm (virtual-machine (operating-system os) - (port-forwardings `((8080 . ,http-port))))) + (port-forwardings `((,http-port . ,forwarded-port))))) (define test (with-imported-modules '((gnu build marionette)) @@ -90,48 +76,69 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) - (test-begin "nginx") + (test-begin #$name) - ;; Wait for nginx to be up and running. - (test-eq "service running" - 'running! + (test-assert #$(string-append name " service running") (marionette-eval '(begin (use-modules (gnu services herd)) - (start-service 'nginx) - 'running!) - marionette)) - - ;; Make sure the PID file is created. - (test-assert "PID file" - (marionette-eval - '(file-exists? "/var/run/nginx/pid") + (match (start-service '#$(string->symbol name)) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((#t) #t) + ((pid) (number? pid)))))) marionette)) ;; Retrieve the index.html file we put in /srv. (test-equal "http-get" '(200 #$%index.html-contents) - (let-values (((response text) - (http-get "http://localhost:8080/index.html" - #:decode-body? #t))) + (let-values + (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/index.html" forwarded-port) + #:decode-body? #t))) (list (response-code response) text))) - ;; There should be a log file in here. - (test-assert "log file" - (marionette-eval - '(file-exists? "/var/log/nginx/access.log") - marionette)) + #$@(if log-file + `((test-assert ,(string-append "log file exists " log-file) + (marionette-eval + '(file-exists? ,log-file) + marionette))) + '()) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) - (gexp->derivation "nginx-test" test)) + (gexp->derivation (string-append name "-test") test)) + + +;;; +;;; NGINX +;;; + +(define %nginx-servers + ;; Server blocks. + (list (nginx-server-configuration + (listen '("8080"))))) + +(define %nginx-os + ;; Operating system under test. + (simple-operating-system + (dhcp-client-service) + (service nginx-service-type + (nginx-configuration + (log-directory "/var/log/nginx") + (server-blocks %nginx-servers))) + (simple-service 'make-http-root activation-service-type + %make-http-root))) (define %test-nginx (system-test (name "nginx") (description "Connect to a running NGINX server.") - (value (run-nginx-test)))) + (value (run-webserver-test name %nginx-os + #:log-file "/var/log/nginx/access.log")))) ;;; -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 24 13:02:19 2017 Received: (at 29741) by debbugs.gnu.org; 24 Dec 2017 18:02:20 +0000 Received: from localhost ([127.0.0.1]:50875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTAbA-0004Qf-9P for submit@debbugs.gnu.org; Sun, 24 Dec 2017 13:02:19 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:42912 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTAb0-0004Py-S6 for 29741@debbugs.gnu.org; Sun, 24 Dec 2017 13:02:02 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 664D613EA19; Sun, 24 Dec 2017 18:01:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (82.38.6.51.dyn.plus.net [51.6.38.82]) by mira.cbaines.net (Postfix) with ESMTPSA id B061513EA1A for <29741@debbugs.gnu.org>; Sun, 24 Dec 2017 18:01:57 +0000 (GMT) Received: from phact.lan (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 27234a31 for <29741@debbugs.gnu.org>; Sun, 24 Dec 2017 18:01:57 +0000 (UTC) From: Christopher Baines To: 29741@debbugs.gnu.org Subject: [PATCH 2/2] gnu: services: web: Add service for httpd. Date: Sun, 24 Dec 2017 18:01:57 +0000 Message-Id: <20171224180157.21873-2-mail@cbaines.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171224180157.21873-1-mail@cbaines.net> References: <87zi6gtkhx.fsf@gnu.org> <20171224180157.21873-1-mail@cbaines.net> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/services/web.scm (, , ): New record types. (%default-httpd-modules, %httpd-accounts, httpd-service-type): New variables. (httpd-shepherd-services, httpd-activation, httpd-process-extensions): New procedures. * gnu/tests/web.scm (run-httpd-test): New procedure. (%httpd-os, %tests-httpd): New variables. * doc/guix.texi (Web Services): Document the Apache HTTP Server. --- doc/guix.texi | 158 ++++++++++++++++++++++++++++++++++- gnu/services/web.scm | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++- gnu/tests/web.scm | 26 +++++- 3 files changed, 409 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index cb6754a4b..21b6ce003 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14814,8 +14814,162 @@ Local accounts with lower values will silently fail to authenticate. @cindex web @cindex www @cindex HTTP -The @code{(gnu services web)} module provides the nginx web server and -also a fastcgi wrapper daemon. +The @code{(gnu services web)} module provides the Apache HTTP Server, +the nginx web server, and also a fastcgi wrapper daemon. + +@subsubheading Apache HTTP Server + +@deffn {Scheme Variable} httpd-service-type +Service type for the @uref{https://httpd.apache.org/,Apache HTTP} +server. The value for this service type is a @code{https-configuration} +record. + +A simple example configuration is given below. + +@example +(service httpd-service-type + (httpd-configuration + (config + (httpd-config-file + (server-name "www.example.com") + (document-root "/srv/http/www.example.com"))))) +@end example + +Other services can also extend the @code{httpd-service-type} to add to +the configuration. + +@example +(simple-service 'my-extra-server httpd-service-type + (list + (httpd-virtualhost + "*:80" + (list (string-append + "ServerName "www.example.com + DocumentRoot \"/srv/http/www.example.com\""))))) +@end example +@end deffn + +The details for the @code{httpd-configuration}, @code{httpd-module}, +@code{httpd-config-file} and @code{httpd-virtualhost} record types are +given below. + +@deffn {Data Type} httpd-configuration +This data type represents the configuration for the httpd service. + +@table @asis +@item @code{package} (default: @code{httpd}) +The httpd package to use. + +@item @code{pid-file} (default: @code{"/var/run/httpd"}) +The pid file used by the shepherd-service. + +@item @code{config} (default: @code{(httpd-config-file)}) +The configuration file to use with the httpd service. The default value +is a @code{httpd-config-file} record, but this can also be a different +G-expression that generates a file, for example a @code{plain-file}. A +file outside of the store can also be specified through a string. + +@end table +@end deffn + +@deffn {Data Type} httpd-module +This data type represents a module for the httpd service. + +@table @asis +@item @code{name} +The name of the module. + +@item @code{file} +The file for the module. This can be relative to the httpd package being +used, the absolute location of a file, or a G-expression for a file +within the store, for example @code{(file-append mod-wsgi +"/modules/mod_wsgi.so")}. + +@end table +@end deffn + +@deffn {Data Type} httpd-config-file +This data type represents a configuration file for the httpd service. + +@table @asis +@item @code{modules} (default: @code{%default-httpd-modules}) +The modules to load. Additional modules can be added here, or loaded by +additional configuration. + +@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 +taken as relative to the server root. + +@item @code{server-name} (default: @code{#f}) +The @code{ServerName} in the configuration file, used to specify the +request scheme, hostname and port that the server uses to identify +itself. + +This doesn't need to be set in the server config, and can be specifyed +in virtual hosts. The default is @code{#f} to not specify a +@code{ServerName}. + +@item @code{document-root} (default: @code{"/srv/http"}) +The @code{DocumentRoot} from which files will be served. + +@item @code{listen} (default: @code{'("80")}) +The list of values for the @code{Listen} directives in the config +file. The value should be a list of strings, when each string can +specify the port number to listen on, and optionally the IP address and +protocol to use. + +@item @code{pid-file} (default: @code{"/var/run/httpd"}) +The @code{PidFile} to use. This should match the @code{pid-file} set in +the @code{httpd-configuration} so that the Shepherd service is +configured correctly. + +@item @code{error-log} (default: @code{"/var/log/httpd/error_log"}) +The @code{ErrorLog} to which the server will log errors. + +@item @code{user} (default: @code{"httpd"}) +The @code{User} which the server will answer requests as. + +@item @code{group} (default: @code{"httpd"}) +The @code{Group} which the server will answer requests as. + +@item @code{extra-config} (default: @code{(list "TypesConfig etc/httpd/mime.types")}) +A flat list of strings and G-expressions which will be added to the end +of the configuration file. + +Any values which the service is extended with will be appended to this +list. + +@end table +@end deffn + +@deffn {Data Type} httpd-virtualhost +This data type represents a virtualhost configuration block for the httpd service. + +These should be added to the extra-config for the httpd-service. + +@example +(simple-service 'my-extra-server httpd-service-type + (list + (httpd-virtualhost + "*:80" + (list (string-append + "ServerName "www.example.com + DocumentRoot \"/srv/http/www.example.com\""))))) +@end example + +@table @asis +@item @code{addresses-and-ports} +The addresses and ports for the @code{VirtualHost} directive. + +@item @code{contents} +The contents of the @code{VirtualHost} directive, this should be a list +of strings and G-expressions. + +@end table +@end deffn + +@subsubheading NGINX @deffn {Scheme Variable} nginx-service-type Service type for the @uref{https://nginx.org/,NGinx} web server. The diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 2371ddb6d..c1ffe3e05 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -34,8 +34,36 @@ #:use-module ((guix utils) #:select (version-major)) #:use-module ((guix packages) #:select (package-version)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) #:use-module (ice-9 match) - #:export ( + #:export ( + httpd-configuration + httpd-configuration? + httpd-configuration-package + httpd-configuration-pid-file + httpd-configuration-config + + + httpd-virtualhost + httpd-virtualhost? + httpd-virtualhost-addresses-and-ports + httpd-virtualhost-contents + + + httpd-config-file + httpd-config-file? + httpd-config-file-modules + httpd-config-file-server-root + httpd-config-file-server-name + httpd-config-file-listen + httpd-config-file-pid-file + httpd-config-file-error-log + httpd-config-file-user + httpd-config-file-group + + httpd-service-type + + nginx-configuration nginx-configuration? nginx-configuartion-nginx @@ -133,6 +161,205 @@ ;;; ;;; Code: +(define-record-type* + httpd-module make-httpd-module + httpd-module? + (name httpd-load-module-name) + (file httpd-load-module-file)) + +;; Default modules for the httpd-service-type, taken from etc/httpd/httpd.conf +;; file in the httpd package. +(define %default-httpd-modules + (map (match-lambda + ((name file) + (httpd-module + (name name) + (file file)))) + '(("authn_file_module" "modules/mod_authn_file.so") + ("authn_core_module" "modules/mod_authn_core.so") + ("authz_host_module" "modules/mod_authz_host.so") + ("authz_groupfile_module" "modules/mod_authz_groupfile.so") + ("authz_user_module" "modules/mod_authz_user.so") + ("authz_core_module" "modules/mod_authz_core.so") + ("access_compat_module" "modules/mod_access_compat.so") + ("auth_basic_module" "modules/mod_auth_basic.so") + ("reqtimeout_module" "modules/mod_reqtimeout.so") + ("filter_module" "modules/mod_filter.so") + ("mime_module" "modules/mod_mime.so") + ("log_config_module" "modules/mod_log_config.so") + ("env_module" "modules/mod_env.so") + ("headers_module" "modules/mod_headers.so") + ("setenvif_module" "modules/mod_setenvif.so") + ("version_module" "modules/mod_version.so") + ("unixd_module" "modules/mod_unixd.so") + ("status_module" "modules/mod_status.so") + ("autoindex_module" "modules/mod_autoindex.so") + ("dir_module" "modules/mod_dir.so") + ("alias_module" "modules/mod_alias.so")))) + +(define-record-type* + httpd-config-file make-httpd-config-file + httpd-config-file? + (modules httpd-config-file-modules + (default %default-httpd-modules)) + (server-root httpd-config-file-server-root + (default httpd)) + (server-name httpd-config-file-server-name + (default #f)) + (document-root httpd-config-file-document-root + (default "/srv/http")) + (listen httpd-config-file-listen + (default '("80"))) + (pid-file httpd-config-file-pid-file + (default "/var/run/httpd")) + (error-log httpd-config-file-error-log + (default "/var/log/httpd/error_log")) + (user httpd-config-file-user + (default "httpd")) + (group httpd-config-file-group + (default "httpd")) + (extra-config httpd-config-file-extra-config + (default + (list "TypesConfig etc/httpd/mime.types")))) + +(define-gexp-compiler (httpd-config-file-compiler + (file ) system target) + (match file + (($ load-modules server-root server-name + document-root listen pid-file error-log + user group extra-config) + (gexp->derivation + "httpd.conf" + #~(call-with-output-file (ungexp output "out") + (lambda (port) + (display + (string-append + (ungexp-splicing + `(,@(append-map + (match-lambda + (($ name module) + `("LoadModule " ,name " " ,module "\n"))) + load-modules) + ,@`("ServerRoot " ,server-root "\n") + ,@(if server-name + `("ServerName " ,server-name "\n") + '()) + ,@`("DocumentRoot " ,document-root "\n") + ,@(append-map + (lambda (listen-value) + `("Listen " ,listen-value "\n")) + listen) + ,@(if pid-file + `("Pidfile " ,pid-file "\n") + '()) + ,@(if error-log + `("ErrorLog " ,error-log "\n") + '()) + ,@(if user + `("User " ,user "\n") + '()) + ,@(if group + `("Group " ,group "\n") + '()) + "\n\n" + ,@extra-config))) + port))) + #:local-build? #t)))) + +(define-record-type + (httpd-virtualhost addresses-and-ports contents) + httpd-virtualhost? + (addresses-and-ports httpd-virtualhost-addresses-and-ports) + (contents httpd-virtualhost-contents)) + +(define-record-type* + httpd-configuration make-httpd-configuration + httpd-configuration? + (package httpd-configuration-package + (default httpd)) + (pid-file httpd-configuration-pid-file + (default "/var/run/httpd")) + (config httpd-configuration-config + (default (httpd-config-file)))) + +(define %httpd-accounts + (list (user-group (name "httpd") (system? #t)) + (user-account + (name "httpd") + (group "httpd") + (system? #t) + (comment "Apache HTTPD server user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define httpd-shepherd-services + (match-lambda + (($ package pid-file config) + (list (shepherd-service + (provision '(httpd)) + (documentation "The Apache HTTP Server") + (requirement '(networking)) + (start #~(make-forkexec-constructor + `(#$(file-append package "/bin/httpd") + #$@(if config + (list "-f" config) + '())) + #:pid-file #$pid-file)) + (stop #~(make-kill-destructor))))))) + +(define httpd-activation + (match-lambda + (($ package pid-file config) + (match-record + config + + (error-log document-root) + #~(begin + (use-modules (guix build utils)) + + (mkdir-p #$(dirname error-log)) + (mkdir-p #$document-root)))))) + +(define (httpd-process-extensions original-config extension-configs) + (let ((config (httpd-configuration-config + original-config))) + (if (httpd-config-file? config) + (httpd-configuration + (inherit original-config) + (config + (httpd-config-file + (inherit config) + (extra-config + (append (httpd-config-file-extra-config config) + (append-map + (match-lambda + (($ + addresses-and-ports + contents) + `(,(string-append + "\n") + ,@contents + "\n\n")) + ((? string? x) + `("\n" ,x "\n")) + ((? list? x) + `("\n" ,@x "\n"))) + extension-configs))))))))) + +(define httpd-service-type + (service-type (name 'httpd) + (extensions + (list (service-extension shepherd-root-service-type + httpd-shepherd-services) + (service-extension activation-service-type + httpd-activation) + (service-extension account-service-type + (const %httpd-accounts)))) + (compose concatenate) + (extend httpd-process-extensions) + (default-value + (httpd-configuration)))) + (define-record-type* nginx-server-configuration make-nginx-server-configuration nginx-server-configuration? diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 5595e9ddf..1912f8f79 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -29,7 +29,8 @@ #:use-module (gnu services networking) #:use-module (guix gexp) #:use-module (guix store) - #:export (%test-nginx + #:export (%test-httpd + %test-nginx %test-php-fpm)) (define %index.html-contents @@ -113,6 +114,29 @@ HTTP-PORT." (gexp->derivation (string-append name "-test") test)) +;;; +;;; HTTPD +;;; + +(define %httpd-os + (simple-operating-system + (dhcp-client-service) + (service httpd-service-type + (httpd-configuration + (config + (httpd-config-file + (listen '("8080")))))) + (simple-service 'make-http-root activation-service-type + %make-http-root))) + +(define %test-httpd + (system-test + (name "httpd") + (description "Connect to a running HTTPD server.") + (value (run-webserver-test name %httpd-os + #:log-file "/var/log/httpd/error_log")))) + + ;;; ;;; NGINX ;;; -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 24 13:08:10 2017 Received: (at 29741) by debbugs.gnu.org; 24 Dec 2017 18:08:10 +0000 Received: from localhost ([127.0.0.1]:50888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTAgw-0004a7-WF for submit@debbugs.gnu.org; Sun, 24 Dec 2017 13:08:10 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:42934 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTAgv-0004Zz-Da for 29741@debbugs.gnu.org; Sun, 24 Dec 2017 13:08:05 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id 2F3E713EA1B; Sun, 24 Dec 2017 18:08:04 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (82.38.6.51.dyn.plus.net [51.6.38.82]) by mira.cbaines.net (Postfix) with ESMTPSA id 47E2A13EA19; Sun, 24 Dec 2017 18:08:03 +0000 (GMT) Received: from phact (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 776a93b9; Sun, 24 Dec 2017 18:08:03 +0000 (UTC) References: <20171216201700.23564-1-mail@cbaines.net> <20171216201700.23564-2-mail@cbaines.net> <87zi6gtkhx.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#29741] [PATCH 2/2] gnu: services: web: Add service for apache-httpd. In-reply-to: <87zi6gtkhx.fsf@gnu.org> Date: Sun, 24 Dec 2017 18:08:00 +0000 Message-ID: <878tdst2wv.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741 Cc: 29741@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hello, > > Christopher Baines skribis: > >> * gnu/services/web.scm (, >> , >> ): New record types. >> (%default-apache-httpd-modules, %apache-httpd-accounts, >> apache-httpd-service-type): New variables. >> (apache-httpd-shepherd-services, apache-httpd-activation, >> apache-httpd-process-extensions): New procedures. >> * gnu/tests/web.scm (run-apache-httpd-test): New procedure. >> (%apache-httpd-os, %tests-apache-httpd): New variables. > > Nice! Documentation will be welcome. :-) Great, I've sent a couple of updated patches, which now include documentation. >> + #:export ( >> + apache-httpd-configuration >> + apache-httpd-configuration? >> + apache-httpd-configuration-package >> + apache-httpd-configuration-pid-file >> + apache-httpd-configuration-config > > In this context I think =E2=80=98httpd-=E2=80=99 would be good enough as = a prefix. Ok, I've changed the prefix to 'httpd-'. >> +(define %default-apache-httpd-modules >> + (map (match-lambda >> + ((name file) >> + (apache-httpd-load-module >> + (name name) >> + (file file)))) >> + '(("authn_file_module" "modules/mod_authn_file.so") >> + ("authn_core_module" "modules/mod_authn_core.so") >> + ("authz_host_module" "modules/mod_authz_host.so") > > I think having this list here is the right approach. However could you > write where it comes from? I guess it=E2=80=99s equal to the current def= ault in > httpd, right? > > How often do you expect this to be updated? I got this from the etc/httpd/httpd.conf file in the httpd package, and I've now added a comment in to the code saying this. I don't expect it will need updating often. >> +(define-record-type* >> + apache-httpd-config-file make-apache-httpd-config-file >> + apache-httpd-config-file? >> + (load-modules apache-httpd-config-file-load-modules >> + (default %default-apache-httpd-modules)) > > Or =E2=80=9Cloaded-modules=E2=80=9D or just =E2=80=9Cmodules=E2=80=9D? I've gone with modules, and changed this field and the corresponding record type. >> +(define* (run-apache-httpd-test #:optional (http-port 8080)) >> + "Run tests in %APACHE-HTTPD-OS, which has apache-httpd running and li= stening on >> +HTTP-PORT." > > I wonder if we could abstract =E2=80=98run-nginx-test=E2=80=99 just enoug= h so it can be > used for both. It=E2=80=99d need to take a service name, log file, and P= ID file > as arguments. That sounds good to me. I've now updated the first patch to generalise the test, so that it can be used for both the nginx and httpd service. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlo/7QBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xes3w//ZJk2mQbSn7a7mBhSJnuj4CVyGDUjhoCp8iXF0+89gczRAMxF5TlzzXnp hlYQhHw939lbmOgtc3ToFs/ekuxGSChW9TeCS0WapkSXMz9HT+FDh4edwDjjcwM1 rYtnGSoi5qny/5FWcwOUedw/axWwNsRbDcBC0y/c6or5MYxagPAWThxNae9Z3K05 uK1b6gkepzEiBS14oclDS2H75RKu8Z05ZLk2BdTszWmfC06CmYH2yalgIwUkuwdu T5NaMMYHTm+z8LuzQm1xQufgQdm+uzbNO2IsFp+LpzTmRC9AWWBxqkhbTgfCgf9S W5r39P7exLUcK9ZrxBFrz/aDhqAGlXEvhAOed5sa2YF4ETIZHFoknCurvUPGyxR8 dQFmfQ5ENSL5Fe2z/P3MupnCaI+HYwq8ix6xTPQud2NNboSoD4gCwa+Poq54+Wvo 8fPbHwMmdTqKeGmgMY+6Bf0cPIkJNOXcMdaqJilKoFHsKnhXIZaZn337h+zonovG trHziQD6csWocIE7Mg9zlDMGZDz8+h7bvA92hnq4/6g2PYjoTifKMG8J8UkBmUqh yPP4GLoi+qPAtexR9ibAdEe1ag9aXB7L63L2ODb6NmVL1zhKKCDa5IN9v/2217e9 eG0w7K4D0FvRyQe0+E3BGQ4CYKwEtP+yBR+YY3s72W1QDMsM/0c= =BCYg -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 11 15:51:56 2018 Received: (at 29741) by debbugs.gnu.org; 11 Jan 2018 20:51:56 +0000 Received: from localhost ([127.0.0.1]:52519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZjpM-0008BI-I3 for submit@debbugs.gnu.org; Thu, 11 Jan 2018 15:51:56 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:35118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZjpK-0008BB-PZ for 29741@debbugs.gnu.org; Thu, 11 Jan 2018 15:51:55 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 3DDD310694; Thu, 11 Jan 2018 21:51:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LpCb9YpQR6qi; Thu, 11 Jan 2018 21:51:53 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6557E101BE; Thu, 11 Jan 2018 21:51:53 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Christopher Baines Subject: Re: [bug#29741] [PATCH 2/2] gnu: services: web: Add service for httpd. Date: Thu, 11 Jan 2018 10:46:13 +0100 References: <87zi6gtkhx.fsf@gnu.org> <20171224180157.21873-1-mail@cbaines.net> <20171224180157.21873-2-mail@cbaines.net> Message-ID: <87d12gp193.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Chris! Sorry for the delay. Christopher Baines skribis: [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.1 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Debbugs-Envelope-To: 29741 Cc: 29741@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Chris! Sorry for the delay. Christopher Baines skribis: [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.1 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record Hi Chris! Sorry for the delay. Christopher Baines skribis: > * gnu/services/web.scm (, > , > ): New record types. > (%default-httpd-modules, %httpd-accounts, > httpd-service-type): New variables. > (httpd-shepherd-services, httpd-activation, > httpd-process-extensions): New procedures. > * gnu/tests/web.scm (run-httpd-test): New procedure. > (%httpd-os, %tests-httpd): New variables. > * doc/guix.texi (Web Services): Document the Apache HTTP Server. [...] > +The @code{(gnu services web)} module provides the Apache HTTP Server, > +the nginx web server, and also a fastcgi wrapper daemon. > + > +@subsubheading Apache HTTP Server > + > +@deffn {Scheme Variable} httpd-service-type > +Service type for the @uref{https://httpd.apache.org/,Apache HTTP} > +server. The value for this service type is a @code{https-configuration} ^ Maybe add =E2=80=9C(@dfn{httpd})=E2=80=9D. Apart from this super-nitpicky comment, this LGTM! :-) Thank you, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 17 03:45:28 2018 Received: (at 29741-done) by debbugs.gnu.org; 17 Jan 2018 08:45:28 +0000 Received: from localhost ([127.0.0.1]:59375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebjLb-0000ju-Ku for submit@debbugs.gnu.org; Wed, 17 Jan 2018 03:45:27 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:33434 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebjLa-0000jn-BC for 29741-done@debbugs.gnu.org; Wed, 17 Jan 2018 03:45:26 -0500 Received: by mira.cbaines.net (Postfix, from userid 113) id A9FBC14086A; Wed, 17 Jan 2018 08:45:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 3173E140868; Wed, 17 Jan 2018 08:45:25 +0000 (GMT) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 7ac15db8; Wed, 17 Jan 2018 08:45:24 +0000 (UTC) References: <87zi6gtkhx.fsf@gnu.org> <20171224180157.21873-1-mail@cbaines.net> <20171224180157.21873-2-mail@cbaines.net> <87d12gp193.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#29741] [PATCH 2/2] gnu: services: web: Add service for httpd. In-reply-to: <87d12gp193.fsf@gnu.org> Date: Wed, 17 Jan 2018 08:45:24 +0000 Message-ID: <87bmhsub4r.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29741-done Cc: 29741-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi Chris! > > Sorry for the delay. > > Christopher Baines skribis: > >> * gnu/services/web.scm (, >> , >> ): New record types. >> (%default-httpd-modules, %httpd-accounts, >> httpd-service-type): New variables. >> (httpd-shepherd-services, httpd-activation, >> httpd-process-extensions): New procedures. >> * gnu/tests/web.scm (run-httpd-test): New procedure. >> (%httpd-os, %tests-httpd): New variables. >> * doc/guix.texi (Web Services): Document the Apache HTTP Server. > > [...] > >> +The @code{(gnu services web)} module provides the Apache HTTP Server, >> +the nginx web server, and also a fastcgi wrapper daemon. >> + >> +@subsubheading Apache HTTP Server >> + >> +@deffn {Scheme Variable} httpd-service-type >> +Service type for the @uref{https://httpd.apache.org/,Apache HTTP} >> +server. The value for this service type is a @code{https-configuration} > ^ > Maybe add =E2=80=9C(@dfn{httpd})=E2=80=9D. > > Apart from this super-nitpicky comment, this LGTM! :-) Great, I've made that change and pushed. Thanks for reviewing Ludo :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlpfDSRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xfh2Q/9G33fS6m/+/HtakpW0yRw0kc4ocHbpG7lzzReQthQxdk+Y4wjJMDs7PES KDKlQN19wcN8ExtA127g33QMMZd45JN1B9MaCJEwlSoXrMZuxghzUP5lHbMaIGaS RwpVCNa78ctOBIvk1E15cqiy7bMjw1ATwH3agScWOoZTVyiRzLk96ZwUsDoqcs/3 ACsoiDFG2q38xGFdnfoeS8wn1S6p712Tpa9vqa7krsZzuixvKhNqDczvRQdwg13E SbLQYvkVlluyWI12Q4oYDcFfXi75QbYHf1MQ7hjHasU45Cq3yq+hn+GxwILHhvGq bKcdpESb0wqbmcD1eA4WC4TH1TSx4oEAmVfwE4gCCKOUQ7dKozIAb5GCtBrZfNCK bzMEpbS9YLvA+ljtcgCDUZp29X6ajLkHX0ErilE6/ky2y3qboOukZMWjPMokcqy3 tQk0DgXKrmUy+hUgPIWka0rFHO/8Iz1cCRGHGMYrE8rjgo3l06b4IMD9wpLFNUvK lsACHdBpBWPTyYzvDls16ckgtL8/38lL3tjVuAYvv0HToKgfmgC3Dztn68InNGgv bTQmeZm3s2xUFXuvsa+3cl6vBMSa+711IGmUHJVZqEmnE1GBgIWEcOSgA74K3xvX CjzMGvZUGBg71QVH6+4FWODUd669maXSRu65U63B6gF35MP4xaQ= =ICEw -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Sep 14 00:11:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 14 Feb 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator