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