]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/leila/production.nix
Remove overlay that overrides the php version
[perso/Immae/Config/Nix.git] / modules / private / websites / leila / production.nix
1 { lib, pkgs, config, ... }:
2 let
3 cfg = config.myServices.websites.leila.production;
4 varDir = "/var/lib/ftp/leila";
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
7 in {
8 options.myServices.websites.leila.production.enable = lib.mkEnableOption "enable Leila's websites in production";
9
10 config = lib.mkIf cfg.enable {
11 services.phpfpm.pools.leila = {
12 user = apacheUser;
13 group = apacheGroup;
14 settings = {
15 "listen.owner" = apacheUser;
16 "listen.group" = apacheGroup;
17
18 "pm" = "ondemand";
19 "pm.max_children" = "5";
20 "pm.process_idle_timeout" = "60";
21
22 "php_admin_value[open_basedir]" = "${varDir}:/tmp";
23 };
24 phpPackage = pkgs.php72;
25 };
26
27 services.webstats.sites = [
28 { name = "leila.bouya.org"; }
29 { name = "chorale.leila.bouya.org"; }
30 { name = "syrwennecreation.bouya.org"; }
31 ];
32
33 services.websites.env.production.modules = [ "proxy_fcgi" ];
34 services.websites.env.production.vhostConfs.leila_chorale = {
35 certName = "leila";
36 addToCerts = true;
37 hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
38 root = "${varDir}/Chorale";
39 extraConfig = [
40 ''
41 Use Stats chorale.leila.bouya.org
42 <Directory ${varDir}/Chorale>
43 DirectoryIndex index.php index.htm index.html
44 Options Indexes FollowSymLinks MultiViews Includes
45 AllowOverride None
46
47 Use LDAPConnect
48 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
49
50 <FilesMatch "\.php$">
51 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
52 </FilesMatch>
53 </Directory>
54 ''
55 ];
56 };
57 services.websites.env.production.vhostConfs.leila_syrwenne = {
58 certName = "leila";
59 addToCerts = true;
60 hosts = [ "syrwennecreation.bouya.org" ];
61 root = "${varDir}/Syrwennecreation";
62 extraConfig = [
63 ''
64 Use Stats syrwennecreation.bouya.org
65 <Directory ${varDir}/Syrwennecreation>
66 DirectoryIndex index.php index.htm index.html
67 Options Indexes FollowSymLinks MultiViews Includes
68 AllowOverride None
69
70 <FilesMatch "\.php$">
71 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
72 </FilesMatch>
73 </Directory>
74 ''
75 ];
76 };
77 services.websites.env.production.vhostConfs.leila = {
78 certName = "leila";
79 certMainHost = "leila.bouya.org";
80 hosts = [ "leila.bouya.org" ];
81 root = varDir;
82 extraConfig = [
83 ''
84 Use Stats leila.bouya.org
85 <Directory ${varDir}/Chorale>
86 DirectoryIndex index.htm index.html
87 Options Indexes FollowSymLinks MultiViews Includes
88 AllowOverride None
89
90 Use LDAPConnect
91 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
92
93 <FilesMatch "\.php$">
94 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
95 </FilesMatch>
96 </Directory>
97 <Directory ${varDir}>
98 DirectoryIndex index.htm index.html
99 Options Indexes FollowSymLinks MultiViews Includes
100 AllowOverride None
101 Require all granted
102 </Directory>
103 ''
104 ];
105 };
106 };
107 }