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/aten/aten.nix | 6 ++++-- nixops/modules/websites/aten/default.nix | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'nixops/modules/websites/aten') diff --git a/nixops/modules/websites/aten/aten.nix b/nixops/modules/websites/aten/aten.nix index 1910a67..f986ec1 100644 --- a/nixops/modules/websites/aten/aten.nix +++ b/nixops/modules/websites/aten/aten.nix @@ -29,10 +29,12 @@ let pm.max_spare_servers = 3 ''}''; }; - apache = { + apache = rec { user = "wwwrun"; group = "wwwrun"; modules = [ "proxy_fcgi" ]; + webappName = "aten_${environment}"; + root = "/run/current-system/webapps/${webappName}"; vhostConf = '' SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" @@ -64,7 +66,7 @@ let ''} - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride All Require all granted diff --git a/nixops/modules/websites/aten/default.nix b/nixops/modules/websites/aten/default.nix index db2ab49..f586ed5 100644 --- a/nixops/modules/websites/aten/default.nix +++ b/nixops/modules/websites/aten/default.nix @@ -42,6 +42,10 @@ in { services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool; system.activationScripts.aten_prod = aten_prod.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${aten_prod.webRoot} $out/webapps/${aten_prod.apache.webappName} + ''; services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules; services.myWebsites.production.modules = aten_prod.apache.modules; services.myWebsites.production.vhostConfs.aten = { @@ -55,11 +59,15 @@ in { security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null; services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool; system.activationScripts.aten_dev = aten_dev.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${aten_dev.webRoot} $out/webapps/${aten_dev.apache.webappName} + ''; services.myWebsites.integration.modules = aten_dev.apache.modules; services.myWebsites.integration.vhostConfs.aten = { certName = "eldiron"; hosts = [ "dev.aten.pro" ]; - root = aten_dev.webRoot; + root = aten_dev.apache.root; extraConfig = [ aten_dev.apache.vhostConf ]; }; }) -- cgit v1.2.3