]>
Commit | Line | Data |
---|---|---|
f8026b6e IB |
1 | { lib, pkgs, config, ... }: |
2 | let | |
3 | cfg = config.myServices.websites.leila.production; | |
4 | varDir = "/var/lib/ftp/leila"; | |
d3452fc5 IB |
5 | apacheUser = config.services.httpd.Prod.user; |
6 | apacheGroup = config.services.httpd.Prod.group; | |
f8026b6e | 7 | in { |
2a670f71 | 8 | options.myServices.websites.leila.production.enable = lib.mkEnableOption "enable Leila's websites in production"; |
f8026b6e IB |
9 | |
10 | config = lib.mkIf cfg.enable { | |
441da8aa | 11 | services.phpfpm.pools.leila = { |
d3452fc5 IB |
12 | user = apacheUser; |
13 | group = apacheGroup; | |
5400b9b6 | 14 | settings = { |
d3452fc5 IB |
15 | "listen.owner" = apacheUser; |
16 | "listen.group" = apacheGroup; | |
f8026b6e | 17 | |
5400b9b6 IB |
18 | "pm" = "ondemand"; |
19 | "pm.max_children" = "5"; | |
20 | "pm.process_idle_timeout" = "60"; | |
f8026b6e | 21 | |
5400b9b6 IB |
22 | "php_admin_value[open_basedir]" = "${varDir}:/tmp"; |
23 | }; | |
dcac3ec7 | 24 | phpPackage = pkgs.php72; |
441da8aa | 25 | }; |
f8026b6e IB |
26 | |
27 | services.webstats.sites = [ | |
28 | { name = "leila.bouya.org"; } | |
29 | { name = "chorale.leila.bouya.org"; } | |
2a670f71 | 30 | { name = "syrwennecreation.bouya.org"; } |
f8026b6e IB |
31 | ]; |
32 | ||
29f8cb85 IB |
33 | services.websites.env.production.modules = [ "proxy_fcgi" ]; |
34 | services.websites.env.production.vhostConfs.leila_chorale = { | |
f8026b6e IB |
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 | ||
2a670f71 | 50 | <FilesMatch "\.php$"> |
5400b9b6 | 51 | SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost" |
2a670f71 IB |
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 | ||
f8026b6e | 70 | <FilesMatch "\.php$"> |
5400b9b6 | 71 | SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost" |
f8026b6e IB |
72 | </FilesMatch> |
73 | </Directory> | |
74 | '' | |
75 | ]; | |
76 | }; | |
29f8cb85 | 77 | services.websites.env.production.vhostConfs.leila = { |
f8026b6e IB |
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$"> | |
5400b9b6 | 94 | SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost" |
f8026b6e IB |
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 | } |