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/ludivine/default.nix | 10 +++++++++- nixops/modules/websites/ludivine/ludivinecassal.nix | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'nixops/modules/websites/ludivine') diff --git a/nixops/modules/websites/ludivine/default.nix b/nixops/modules/websites/ludivine/default.nix index d13d700..bcbef51 100644 --- a/nixops/modules/websites/ludivine/default.nix +++ b/nixops/modules/websites/ludivine/default.nix @@ -38,6 +38,10 @@ in { services.myPhpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal_prod.phpFpm.pool; system.activationScripts.ludivinecassal_prod = ludivinecassal_prod.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${ludivinecassal_prod.webRoot} $out/webapps/${ludivinecassal_prod.apache.webappName} + ''; services.myWebsites.production.modules = ludivinecassal_prod.apache.modules; services.myWebsites.production.vhostConfs.ludivine = { certName = "ludivinecassal"; @@ -51,12 +55,16 @@ in { services.myPhpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal_dev.phpFpm.pool; system.activationScripts.ludivinecassal_dev = ludivinecassal_dev.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${ludivinecassal_dev.webRoot} $out/webapps/${ludivinecassal_dev.apache.webappName} + ''; services.myWebsites.apacheConfig.ludivinecassal_dev.modules = ludivinecassal_dev.apache.modules; services.myWebsites.integration.modules = ludivinecassal_dev.apache.modules; services.myWebsites.integration.vhostConfs.ludivine = { certName = "eldiron"; hosts = [ "ludivine.immae.eu" ]; - root = ludivinecassal_dev.webRoot; + root = ludivinecassal_dev.apache.root; extraConfig = [ ludivinecassal_dev.apache.vhostConf ]; }; }) diff --git a/nixops/modules/websites/ludivine/ludivinecassal.nix b/nixops/modules/websites/ludivine/ludivinecassal.nix index 4ce06b2..02614a5 100644 --- a/nixops/modules/websites/ludivine/ludivinecassal.nix +++ b/nixops/modules/websites/ludivine/ludivinecassal.nix @@ -60,10 +60,12 @@ let pm.max_spare_servers = 3 ''}''; }; - apache = { + apache = rec { user = "wwwrun"; group = "wwwrun"; modules = [ "proxy_fcgi" ]; + webappName = "ludivine_${environment}"; + root = "/run/current-system/webapps/${webappName}"; vhostConf = '' SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" @@ -76,7 +78,7 @@ let ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride None Require all granted -- cgit v1.2.3