1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.leila.production;
4 varDir = "/var/lib/ftp/leila";
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
8 options.myServices.websites.leila.production.enable = lib.mkEnableOption "enable Leila's websites in production";
10 config = lib.mkIf cfg.enable {
11 services.phpfpm.pools.leila = {
15 "listen.owner" = apacheUser;
16 "listen.group" = apacheGroup;
19 "pm.max_children" = "5";
20 "pm.process_idle_timeout" = "60";
22 "php_admin_value[open_basedir]" = "${varDir}:/tmp";
23 "php_admin_value[max_execution_time]" = "1800";
25 phpOptions = config.services.phpfpm.phpOptions + ''
26 disable_functions = "mail"
28 phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.imagick ]);
30 PATH = lib.makeBinPath [ pkgs.imagemagick ];
34 services.webstats.sites = [
35 { name = "leila.bouya.org"; }
36 { name = "chorale.leila.bouya.org"; }
37 { name = "syrwennecreation.bouya.org"; }
40 services.websites.env.production.modules = [ "proxy_fcgi" ];
41 services.websites.env.production.vhostConfs.leila_chorale = {
44 hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
45 root = "${varDir}/Chorale";
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
55 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
58 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
64 services.websites.env.production.vhostConfs.leila_syrwenne = {
67 hosts = [ "syrwennecreation.bouya.org" ];
68 root = "${varDir}/Syrwennecreation";
71 Use Stats syrwennecreation.bouya.org
72 <Directory ${varDir}/Syrwennecreation>
73 DirectoryIndex index.php index.htm index.html
74 Options Indexes FollowSymLinks MultiViews Includes
78 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
84 services.websites.env.production.vhostConfs.leila = {
86 certMainHost = "leila.bouya.org";
87 hosts = [ "leila.bouya.org" ];
91 Use Stats leila.bouya.org
92 <Directory ${varDir}/Chorale>
93 DirectoryIndex index.htm index.html
94 Options Indexes FollowSymLinks MultiViews Includes
98 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
100 <FilesMatch "\.php$">
101 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
104 <Directory ${varDir}>
105 DirectoryIndex index.htm index.html
106 Options Indexes FollowSymLinks MultiViews Includes