]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/ressourcerie_banon/production.nix
Ateliers du changement
[perso/Immae/Config/Nix.git] / modules / private / websites / ressourcerie_banon / production.nix
index a3abccabbc9d527a511a55376a97a1c12dfb70fa..fb856853ead6c89c5f6d0ea867628ddb3253ef6f 100644 (file)
@@ -10,12 +10,6 @@ in {
   config = lib.mkIf cfg.enable {
     services.webstats.sites = [ { name = "ressourcerie-banon.org"; } ];
 
-    system.activationScripts.ressourcerie_banon = {
-      deps = [ "httpd" ];
-      text = ''
-        install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/ressourcerie_banon
-        '';
-    };
     systemd.services.phpfpm-ressourcerie_banon.after = lib.mkAfter [ "mysql.service" ];
     systemd.services.phpfpm-ressourcerie_banon.wants = [ "mysql.service" ];
     services.phpfpm.pools.ressourcerie_banon = {
@@ -25,17 +19,20 @@ in {
         "listen.owner" = apacheUser;
         "listen.group" = apacheGroup;
 
-        "pm" = "ondemand";
-        "pm.max_children" = "5";
-        "pm.process_idle_timeout" = "60";
+        "pm" = "dynamic";
+        "pm.max_children" = "20";
+        "pm.start_servers" = "2";
+        "pm.min_spare_servers" = "1";
+        "pm.max_spare_servers" = "3";
 
-        "php_admin_value[open_basedir]" = "/var/lib/php/sessions/ressourcerie_banon:${varDir}:/tmp";
-        "php_admin_value[session.save_path]" = "/var/lib/php/sessions/ressourcerie_banon";
+        "php_admin_value[session.save_handler]" = "redis";
+        "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=RessourcerieBanon:Production:'";
+        "php_admin_value[open_basedir]" = "${varDir}:/tmp";
       };
       phpOptions = config.services.phpfpm.phpOptions + ''
         disable_functions = "mail"
       '';
-      phpPackage = pkgs.php72;
+      phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]);
     };
     services.websites.env.production.modules = [ "proxy_fcgi" ];
     services.websites.env.production.vhostConfs.ressourcerie_banon = {