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