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/ludivine | |
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/ludivine')
-rw-r--r-- | nixops/modules/websites/ludivine/default.nix | 10 | ||||
-rw-r--r-- | nixops/modules/websites/ludivine/ludivinecassal.nix | 6 |
2 files changed, 13 insertions, 3 deletions
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 { | |||
38 | 38 | ||
39 | services.myPhpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal_prod.phpFpm.pool; | 39 | services.myPhpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal_prod.phpFpm.pool; |
40 | system.activationScripts.ludivinecassal_prod = ludivinecassal_prod.activationScript; | 40 | system.activationScripts.ludivinecassal_prod = ludivinecassal_prod.activationScript; |
41 | system.extraSystemBuilderCmds = '' | ||
42 | mkdir -p $out/webapps | ||
43 | ln -s ${ludivinecassal_prod.webRoot} $out/webapps/${ludivinecassal_prod.apache.webappName} | ||
44 | ''; | ||
41 | services.myWebsites.production.modules = ludivinecassal_prod.apache.modules; | 45 | services.myWebsites.production.modules = ludivinecassal_prod.apache.modules; |
42 | services.myWebsites.production.vhostConfs.ludivine = { | 46 | services.myWebsites.production.vhostConfs.ludivine = { |
43 | certName = "ludivinecassal"; | 47 | certName = "ludivinecassal"; |
@@ -51,12 +55,16 @@ in { | |||
51 | 55 | ||
52 | services.myPhpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal_dev.phpFpm.pool; | 56 | services.myPhpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal_dev.phpFpm.pool; |
53 | system.activationScripts.ludivinecassal_dev = ludivinecassal_dev.activationScript; | 57 | system.activationScripts.ludivinecassal_dev = ludivinecassal_dev.activationScript; |
58 | system.extraSystemBuilderCmds = '' | ||
59 | mkdir -p $out/webapps | ||
60 | ln -s ${ludivinecassal_dev.webRoot} $out/webapps/${ludivinecassal_dev.apache.webappName} | ||
61 | ''; | ||
54 | services.myWebsites.apacheConfig.ludivinecassal_dev.modules = ludivinecassal_dev.apache.modules; | 62 | services.myWebsites.apacheConfig.ludivinecassal_dev.modules = ludivinecassal_dev.apache.modules; |
55 | services.myWebsites.integration.modules = ludivinecassal_dev.apache.modules; | 63 | services.myWebsites.integration.modules = ludivinecassal_dev.apache.modules; |
56 | services.myWebsites.integration.vhostConfs.ludivine = { | 64 | services.myWebsites.integration.vhostConfs.ludivine = { |
57 | certName = "eldiron"; | 65 | certName = "eldiron"; |
58 | hosts = [ "ludivine.immae.eu" ]; | 66 | hosts = [ "ludivine.immae.eu" ]; |
59 | root = ludivinecassal_dev.webRoot; | 67 | root = ludivinecassal_dev.apache.root; |
60 | extraConfig = [ ludivinecassal_dev.apache.vhostConf ]; | 68 | extraConfig = [ ludivinecassal_dev.apache.vhostConf ]; |
61 | }; | 69 | }; |
62 | }) | 70 | }) |
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 | |||
60 | pm.max_spare_servers = 3 | 60 | pm.max_spare_servers = 3 |
61 | ''}''; | 61 | ''}''; |
62 | }; | 62 | }; |
63 | apache = { | 63 | apache = rec { |
64 | user = "wwwrun"; | 64 | user = "wwwrun"; |
65 | group = "wwwrun"; | 65 | group = "wwwrun"; |
66 | modules = [ "proxy_fcgi" ]; | 66 | modules = [ "proxy_fcgi" ]; |
67 | webappName = "ludivine_${environment}"; | ||
68 | root = "/run/current-system/webapps/${webappName}"; | ||
67 | vhostConf = '' | 69 | vhostConf = '' |
68 | <FilesMatch "\.php$"> | 70 | <FilesMatch "\.php$"> |
69 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 71 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" |
@@ -76,7 +78,7 @@ let | |||
76 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://ludivinecassal.com\"></html>" | 78 | ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://ludivinecassal.com\"></html>" |
77 | </Location> | 79 | </Location> |
78 | 80 | ||
79 | <Directory ${webRoot}> | 81 | <Directory ${root}> |
80 | Options Indexes FollowSymLinks MultiViews Includes | 82 | Options Indexes FollowSymLinks MultiViews Includes |
81 | AllowOverride None | 83 | AllowOverride None |
82 | Require all granted | 84 | Require all granted |