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