diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-16 14:09:27 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-16 14:09:27 +0100 |
commit | e5073addbe397afd596613af469f3308a07c1801 (patch) | |
tree | 943148dbdbfb9aeeccf9c5a5d945a7398205f03d /nixops/modules/websites/aten | |
parent | a556c4b01a536afd90042dad95e7cc09f37d4056 (diff) | |
download | Nix-e5073addbe397afd596613af469f3308a07c1801.tar.gz Nix-e5073addbe397afd596613af469f3308a07c1801.tar.zst Nix-e5073addbe397afd596613af469f3308a07c1801.zip |
Move integration websites to use stable web directory
This permits to avoir having to restart httpd at each application
deployment
Diffstat (limited to 'nixops/modules/websites/aten')
-rw-r--r-- | nixops/modules/websites/aten/aten.nix | 6 | ||||
-rw-r--r-- | nixops/modules/websites/aten/default.nix | 10 |
2 files changed, 13 insertions, 3 deletions
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 | |||
29 | pm.max_spare_servers = 3 | 29 | pm.max_spare_servers = 3 |
30 | ''}''; | 30 | ''}''; |
31 | }; | 31 | }; |
32 | apache = { | 32 | apache = rec { |
33 | user = "wwwrun"; | 33 | user = "wwwrun"; |
34 | group = "wwwrun"; | 34 | group = "wwwrun"; |
35 | modules = [ "proxy_fcgi" ]; | 35 | modules = [ "proxy_fcgi" ]; |
36 | webappName = "aten_${environment}"; | ||
37 | root = "/run/current-system/webapps/${webappName}"; | ||
36 | vhostConf = '' | 38 | vhostConf = '' |
37 | <FilesMatch "\.php$"> | 39 | <FilesMatch "\.php$"> |
38 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 40 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" |
@@ -64,7 +66,7 @@ let | |||
64 | </Location> | 66 | </Location> |
65 | ''} | 67 | ''} |
66 | 68 | ||
67 | <Directory ${webRoot}> | 69 | <Directory ${if environment == "dev" then root else webRoot}> |
68 | Options Indexes FollowSymLinks MultiViews Includes | 70 | Options Indexes FollowSymLinks MultiViews Includes |
69 | AllowOverride All | 71 | AllowOverride All |
70 | Require all granted | 72 | 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 { | |||
42 | 42 | ||
43 | services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool; | 43 | services.myPhpfpm.poolConfigs.aten_prod = aten_prod.phpFpm.pool; |
44 | system.activationScripts.aten_prod = aten_prod.activationScript; | 44 | system.activationScripts.aten_prod = aten_prod.activationScript; |
45 | system.extraSystemBuilderCmds = '' | ||
46 | mkdir -p $out/webapps | ||
47 | ln -s ${aten_prod.webRoot} $out/webapps/${aten_prod.apache.webappName} | ||
48 | ''; | ||
45 | services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules; | 49 | services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules; |
46 | services.myWebsites.production.modules = aten_prod.apache.modules; | 50 | services.myWebsites.production.modules = aten_prod.apache.modules; |
47 | services.myWebsites.production.vhostConfs.aten = { | 51 | services.myWebsites.production.vhostConfs.aten = { |
@@ -55,11 +59,15 @@ in { | |||
55 | security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null; | 59 | security.acme.certs."eldiron".extraDomains."dev.aten.pro" = null; |
56 | services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool; | 60 | services.myPhpfpm.poolConfigs.aten_dev = aten_dev.phpFpm.pool; |
57 | system.activationScripts.aten_dev = aten_dev.activationScript; | 61 | system.activationScripts.aten_dev = aten_dev.activationScript; |
62 | system.extraSystemBuilderCmds = '' | ||
63 | mkdir -p $out/webapps | ||
64 | ln -s ${aten_dev.webRoot} $out/webapps/${aten_dev.apache.webappName} | ||
65 | ''; | ||
58 | services.myWebsites.integration.modules = aten_dev.apache.modules; | 66 | services.myWebsites.integration.modules = aten_dev.apache.modules; |
59 | services.myWebsites.integration.vhostConfs.aten = { | 67 | services.myWebsites.integration.vhostConfs.aten = { |
60 | certName = "eldiron"; | 68 | certName = "eldiron"; |
61 | hosts = [ "dev.aten.pro" ]; | 69 | hosts = [ "dev.aten.pro" ]; |
62 | root = aten_dev.webRoot; | 70 | root = aten_dev.apache.root; |
63 | extraConfig = [ aten_dev.apache.vhostConf ]; | 71 | extraConfig = [ aten_dev.apache.vhostConf ]; |
64 | }; | 72 | }; |
65 | }) | 73 | }) |