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" = "20";
20 "pm.start_servers" = "2";
21 "pm.min_spare_servers" = "1";
22 "pm.max_spare_servers" = "3";
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:'";
26 "php_admin_value[open_basedir]" = "${varDir}:/tmp";
27 "php_admin_value[max_execution_time]" = "1800";
29 phpOptions = config.services.phpfpm.phpOptions + ''
30 disable_functions = "mail"
32 phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.imagick all.redis ]);
34 PATH = lib.makeBinPath [ pkgs.imagemagick ];
38 services.webstats.sites = [
39 { name = "leila.bouya.org"; }
40 { name = "chorale.leila.bouya.org"; }
41 { name = "syrwennecreation.bouya.org"; }
44 services.websites.env.production.modules = [ "proxy_fcgi" ];
45 services.websites.env.production.vhostConfs.leila_chorale = {
48 hosts = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
49 root = "${varDir}/Chorale";
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
59 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
62 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
68 services.websites.env.production.vhostConfs.leila_syrwenne = {
71 hosts = [ "syrwennecreation.bouya.org" ];
72 root = "${varDir}/Syrwennecreation";
75 Use Stats syrwennecreation.bouya.org
76 <Directory ${varDir}/Syrwennecreation>
77 DirectoryIndex index.php index.htm index.html
78 Options Indexes FollowSymLinks MultiViews Includes
82 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
88 services.websites.env.production.vhostConfs.leila = {
90 certMainHost = "leila.bouya.org";
91 hosts = [ "leila.bouya.org" ];
95 Use Stats leila.bouya.org
96 <Directory ${varDir}/Chorale>
97 DirectoryIndex index.htm index.html
98 Options Indexes FollowSymLinks MultiViews Includes
102 Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
104 <FilesMatch "\.php$">
105 SetHandler "proxy:unix:${config.services.phpfpm.pools.leila.socket}|fcgi://localhost"
108 <Directory ${varDir}>
109 DirectoryIndex index.htm index.html
110 Options Indexes FollowSymLinks MultiViews Includes