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