From e5073addbe397afd596613af469f3308a07c1801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 16 Feb 2019 14:09:27 +0100 Subject: Move integration websites to use stable web directory This permits to avoir having to restart httpd at each application deployment --- nixops/modules/websites/piedsjaloux/default.nix | 10 +++++++++- nixops/modules/websites/piedsjaloux/piedsjaloux.nix | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'nixops/modules/websites/piedsjaloux') diff --git a/nixops/modules/websites/piedsjaloux/default.nix b/nixops/modules/websites/piedsjaloux/default.nix index f1bb760..584e936 100644 --- a/nixops/modules/websites/piedsjaloux/default.nix +++ b/nixops/modules/websites/piedsjaloux/default.nix @@ -42,6 +42,10 @@ in { services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool; system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${piedsjaloux_prod.webRoot} $out/webapps/${piedsjaloux_prod.apache.webappName} + ''; services.myWebsites.production.modules = piedsjaloux_prod.apache.modules; services.myWebsites.production.vhostConfs.piedsjaloux = { certName = "piedsjaloux"; @@ -54,11 +58,15 @@ in { security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null; services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool; system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${piedsjaloux_dev.webRoot} $out/webapps/${piedsjaloux_dev.apache.webappName} + ''; services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules; services.myWebsites.integration.vhostConfs.piedsjaloux = { certName = "eldiron"; hosts = [ "piedsjaloux.immae.eu" ]; - root = piedsjaloux_dev.webRoot; + root = piedsjaloux_dev.apache.root; extraConfig = [ piedsjaloux_dev.apache.vhostConf ]; }; }) diff --git a/nixops/modules/websites/piedsjaloux/piedsjaloux.nix b/nixops/modules/websites/piedsjaloux/piedsjaloux.nix index 2871b0f..a2d9a12 100644 --- a/nixops/modules/websites/piedsjaloux/piedsjaloux.nix +++ b/nixops/modules/websites/piedsjaloux/piedsjaloux.nix @@ -49,10 +49,12 @@ let pm.max_spare_servers = 3 ''}''; }; - apache = { + apache = rec { user = "wwwrun"; group = "wwwrun"; modules = [ "proxy_fcgi" ]; + webappName = "piedsjaloux_${environment}"; + root = "/run/current-system/webapps/${webappName}"; vhostConf = '' SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" @@ -65,7 +67,7 @@ let ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride None Require all granted -- cgit v1.2.3