]>
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 | }; | |
441da8aa | 24 | }; |
f8026b6e IB |
25 | |
26 | services.webstats.sites = [ | |
27 | { name = "leila.bouya.org"; } | |
28 | { name = "chorale.leila.bouya.org"; } | |
2a670f71 | 29 | { name = "syrwennecreation.bouya.org"; } |
f8026b6e IB |
30 | ]; |
31 | ||
29f8cb85 IB |
32 | services.websites.env.production.modules = [ "proxy_fcgi" ]; |
33 | services.websites.env.production.vhostConfs.leila_chorale = { | |
f8026b6e IB |
34 | certName = "leila"; |
35 | addToCerts = true; | |
36 | hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ]; | |
37 | root = "${varDir}/Chorale"; | |
38 | extraConfig = [ | |
39 | '' | |
40 | Use Stats chorale.leila.bouya.org | |
41 | <Directory ${varDir}/Chorale> | |
42 | DirectoryIndex index.php index.htm index.html | |
43 | Options Indexes FollowSymLinks MultiViews Includes | |
44 | AllowOverride None | |
45 | ||
46 | Use LDAPConnect | |
47 | Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu | |
48 | ||
2a670f71 | 49 | <FilesMatch "\.php$"> |
5400b9b6 | 50 | SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost" |
2a670f71 IB |
51 | </FilesMatch> |
52 | </Directory> | |
53 | '' | |
54 | ]; | |
55 | }; | |
56 | services.websites.env.production.vhostConfs.leila_syrwenne = { | |
57 | certName = "leila"; | |
58 | addToCerts = true; | |
59 | hosts = [ "syrwennecreation.bouya.org" ]; | |
60 | root = "${varDir}/Syrwennecreation"; | |
61 | extraConfig = [ | |
62 | '' | |
63 | Use Stats syrwennecreation.bouya.org | |
64 | <Directory ${varDir}/Syrwennecreation> | |
65 | DirectoryIndex index.php index.htm index.html | |
66 | Options Indexes FollowSymLinks MultiViews Includes | |
67 | AllowOverride None | |
68 | ||
f8026b6e | 69 | <FilesMatch "\.php$"> |
5400b9b6 | 70 | SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost" |
f8026b6e IB |
71 | </FilesMatch> |
72 | </Directory> | |
73 | '' | |
74 | ]; | |
75 | }; | |
29f8cb85 | 76 | services.websites.env.production.vhostConfs.leila = { |
f8026b6e IB |
77 | certName = "leila"; |
78 | certMainHost = "leila.bouya.org"; | |
79 | hosts = [ "leila.bouya.org" ]; | |
80 | root = varDir; | |
81 | extraConfig = [ | |
82 | '' | |
83 | Use Stats leila.bouya.org | |
84 | <Directory ${varDir}/Chorale> | |
85 | DirectoryIndex index.htm index.html | |
86 | Options Indexes FollowSymLinks MultiViews Includes | |
87 | AllowOverride None | |
88 | ||
89 | Use LDAPConnect | |
90 | Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu | |
91 | ||
92 | <FilesMatch "\.php$"> | |
5400b9b6 | 93 | SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost" |
f8026b6e IB |
94 | </FilesMatch> |
95 | </Directory> | |
96 | <Directory ${varDir}> | |
97 | DirectoryIndex index.htm index.html | |
98 | Options Indexes FollowSymLinks MultiViews Includes | |
99 | AllowOverride None | |
100 | Require all granted | |
101 | </Directory> | |
102 | '' | |
103 | ]; | |
104 | }; | |
105 | }; | |
106 | } |