1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.evariste.production;
4 nsiVarDir = "/var/lib/ftp/nsievariste";
5 stmgVarDir = "/var/lib/ftp/stmgevariste";
7 options.myServices.websites.evariste.production.enable = lib.mkEnableOption "enable NSI/STMG Evariste website";
9 config = lib.mkIf cfg.enable {
10 services.webstats.sites = [
11 { name = "nsievariste.immae.eu"; }
12 { name = "stmgevariste.immae.eu"; }
15 services.websites.env.production.modules = [ "proxy_fcgi" ];
16 system.activationScripts.evariste = {
19 install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/nsievariste
20 install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/stmgevariste
23 services.phpfpm.pools.nsievariste = {
27 "listen.owner" = "wwwrun";
28 "listen.group" = "wwwrun";
31 "pm.max_children" = "5";
32 "pm.process_idle_timeout" = "60";
34 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/nsievariste:${nsiVarDir}:/tmp";
35 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/nsievariste";
38 services.websites.env.production.vhostConfs.nsievariste = {
41 hosts = ["nsievariste.immae.eu" ];
45 Use Stats nsievariste.immae.eu
48 SetHandler "proxy:unix:${config.services.phpfpm.pools.nsievariste.socket}|fcgi://localhost"
51 <Directory ${nsiVarDir}>
52 DirectoryIndex index.php index.htm index.html
53 Options Indexes FollowSymLinks MultiViews Includes
61 services.phpfpm.pools.stmgevariste = {
65 "listen.owner" = "wwwrun";
66 "listen.group" = "wwwrun";
69 "pm.max_children" = "5";
70 "pm.process_idle_timeout" = "60";
72 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/stmgevariste:${stmgVarDir}:/tmp";
73 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/stmgevariste";
76 services.websites.env.production.vhostConfs.stmgevariste = {
79 hosts = ["stmgevariste.immae.eu" ];
83 Use Stats stmgevariste.immae.eu
86 SetHandler "proxy:unix:${config.services.phpfpm.pools.stmgevariste.socket}|fcgi://localhost"
89 <Directory ${stmgVarDir}>
90 DirectoryIndex index.php index.htm index.html
91 Options Indexes FollowSymLinks MultiViews Includes