+++ /dev/null
-{ lib, pkgs, config, ... }:
-let
- cfg = config.myServices.websites.evariste.production;
- nsiVarDir = "/var/lib/ftp/nsievariste";
- stmgVarDir = "/var/lib/ftp/stmgevariste";
-in {
- options.myServices.websites.evariste.production.enable = lib.mkEnableOption "enable NSI/STMG Evariste website";
-
- config = lib.mkIf cfg.enable {
- services.webstats.sites = [
- { name = "nsievariste.immae.eu"; }
- { name = "stmgevariste.immae.eu"; }
- ];
-
- services.websites.env.production.modules = [ "proxy_fcgi" ];
- system.activationScripts.evariste = {
- deps = [ "httpd" ];
- text = ''
- install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/nsievariste
- install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/stmgevariste
- '';
- };
- services.phpfpm.pools.nsievariste = {
- user = "wwwrun";
- group = "wwwrun";
- settings = {
- "listen.owner" = "wwwrun";
- "listen.group" = "wwwrun";
-
- "pm" = "ondemand";
- "pm.max_children" = "5";
- "pm.process_idle_timeout" = "60";
-
- "php_admin_value[open_basedir]" = "/var/lib/php/sessions/nsievariste:${nsiVarDir}:/tmp";
- "php_admin_value[session.save_path]" = "/var/lib/php/sessions/nsievariste";
- };
- };
- services.websites.env.production.vhostConfs.nsievariste = {
- certName = "eldiron";
- addToCerts = true;
- hosts = ["nsievariste.immae.eu" ];
- root = nsiVarDir;
- extraConfig = [
- ''
- Use Stats nsievariste.immae.eu
-
- <FilesMatch "\.php$">
- SetHandler "proxy:unix:${config.services.phpfpm.pools.nsievariste.socket}|fcgi://localhost"
- </FilesMatch>
-
- <Directory ${nsiVarDir}>
- DirectoryIndex index.php index.htm index.html
- Options Indexes FollowSymLinks MultiViews Includes
- AllowOverride None
- Require all granted
- </Directory>
- ''
- ];
- };
-
- services.phpfpm.pools.stmgevariste = {
- user = "wwwrun";
- group = "wwwrun";
- settings = {
- "listen.owner" = "wwwrun";
- "listen.group" = "wwwrun";
-
- "pm" = "ondemand";
- "pm.max_children" = "5";
- "pm.process_idle_timeout" = "60";
-
- "php_admin_value[open_basedir]" = "/var/lib/php/sessions/stmgevariste:${stmgVarDir}:/tmp";
- "php_admin_value[session.save_path]" = "/var/lib/php/sessions/stmgevariste";
- };
- };
- services.websites.env.production.vhostConfs.stmgevariste = {
- certName = "eldiron";
- addToCerts = true;
- hosts = ["stmgevariste.immae.eu" ];
- root = stmgVarDir;
- extraConfig = [
- ''
- Use Stats stmgevariste.immae.eu
-
- <FilesMatch "\.php$">
- SetHandler "proxy:unix:${config.services.phpfpm.pools.stmgevariste.socket}|fcgi://localhost"
- </FilesMatch>
-
- <Directory ${stmgVarDir}>
- DirectoryIndex index.php index.htm index.html
- Options Indexes FollowSymLinks MultiViews Includes
- AllowOverride None
- Require all granted
- </Directory>
- ''
- ];
- };
- };
-}