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/piedsjaloux | |
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/piedsjaloux')
-rw-r--r-- | nixops/modules/websites/piedsjaloux/default.nix | 10 | ||||
-rw-r--r-- | nixops/modules/websites/piedsjaloux/piedsjaloux.nix | 6 |
2 files changed, 13 insertions, 3 deletions
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 { | |||
42 | 42 | ||
43 | services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool; | 43 | services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux_prod.phpFpm.pool; |
44 | system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript; | 44 | system.activationScripts.piedsjaloux_prod = piedsjaloux_prod.activationScript; |
45 | system.extraSystemBuilderCmds = '' | ||
46 | mkdir -p $out/webapps | ||
47 | ln -s ${piedsjaloux_prod.webRoot} $out/webapps/${piedsjaloux_prod.apache.webappName} | ||
48 | ''; | ||
45 | services.myWebsites.production.modules = piedsjaloux_prod.apache.modules; | 49 | services.myWebsites.production.modules = piedsjaloux_prod.apache.modules; |
46 | services.myWebsites.production.vhostConfs.piedsjaloux = { | 50 | services.myWebsites.production.vhostConfs.piedsjaloux = { |
47 | certName = "piedsjaloux"; | 51 | certName = "piedsjaloux"; |
@@ -54,11 +58,15 @@ in { | |||
54 | security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null; | 58 | security.acme.certs."eldiron".extraDomains."piedsjaloux.immae.eu" = null; |
55 | services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool; | 59 | services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux_dev.phpFpm.pool; |
56 | system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript; | 60 | system.activationScripts.piedsjaloux_dev = piedsjaloux_dev.activationScript; |
61 | system.extraSystemBuilderCmds = '' | ||
62 | mkdir -p $out/webapps | ||
63 | ln -s ${piedsjaloux_dev.webRoot} $out/webapps/${piedsjaloux_dev.apache.webappName} | ||
64 | ''; | ||
57 | services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules; | 65 | services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules; |
58 | services.myWebsites.integration.vhostConfs.piedsjaloux = { | 66 | services.myWebsites.integration.vhostConfs.piedsjaloux = { |
59 | certName = "eldiron"; | 67 | certName = "eldiron"; |
60 | hosts = [ "piedsjaloux.immae.eu" ]; | 68 | hosts = [ "piedsjaloux.immae.eu" ]; |
61 | root = piedsjaloux_dev.webRoot; | 69 | root = piedsjaloux_dev.apache.root; |
62 | extraConfig = [ piedsjaloux_dev.apache.vhostConf ]; | 70 | extraConfig = [ piedsjaloux_dev.apache.vhostConf ]; |
63 | }; | 71 | }; |
64 | }) | 72 | }) |
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 | |||
49 | pm.max_spare_servers = 3 | 49 | pm.max_spare_servers = 3 |
50 | ''}''; | 50 | ''}''; |
51 | }; | 51 | }; |
52 | apache = { | 52 | apache = rec { |
53 | user = "wwwrun"; | 53 | user = "wwwrun"; |
54 | group = "wwwrun"; | 54 | group = "wwwrun"; |
55 | modules = [ "proxy_fcgi" ]; | 55 | modules = [ "proxy_fcgi" ]; |
56 | webappName = "piedsjaloux_${environment}"; | ||
57 | root = "/run/current-system/webapps/${webappName}"; | ||
56 | vhostConf = '' | 58 | vhostConf = '' |
57 | <FilesMatch "\.php$"> | 59 | <FilesMatch "\.php$"> |
58 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 60 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" |
@@ -65,7 +67,7 @@ let | |||
65 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://piedsjaloux.fr\"></html>" | 67 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://piedsjaloux.fr\"></html>" |
66 | </Location> | 68 | </Location> |
67 | 69 | ||
68 | <Directory ${webRoot}> | 70 | <Directory ${root}> |
69 | Options Indexes FollowSymLinks MultiViews Includes | 71 | Options Indexes FollowSymLinks MultiViews Includes |
70 | AllowOverride None | 72 | AllowOverride None |
71 | Require all granted | 73 | Require all granted |