1 { lib, pkgs, config, ... }:
3 adminer = pkgs.callPackage ../commons/adminer.nix { inherit config; };
4 cfg = config.myServices.websites.telio_tortay.production;
5 varDir = "/var/lib/ftp/telio_tortay";
6 env = config.myEnv.websites.telio_tortay;
7 apacheUser = config.services.httpd.Prod.user;
8 apacheGroup = config.services.httpd.Prod.group;
10 options.myServices.websites.telio_tortay.production.enable = lib.mkEnableOption "enable Telio Tortay's website";
12 config = lib.mkIf cfg.enable {
13 services.webstats.sites = [ { name = "telio-tortay.immae.eu"; } ];
15 security.acme.certs."ftp".extraDomains."telio-tortay.immae.eu" = null;
17 system.activationScripts.telio_tortay = {
20 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/ftp/telio_tortay/logs
21 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/telio_tortay
24 systemd.services.phpfpm-telio_tortay.after = lib.mkAfter [ "mysql.service" ];
25 systemd.services.phpfpm-telio_tortay.wants = [ "mysql.service" ];
26 services.phpfpm.pools.telio_tortay = {
30 "listen.owner" = apacheUser;
31 "listen.group" = apacheGroup;
34 "pm.max_children" = "5";
35 "pm.process_idle_timeout" = "60";
37 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/telio_tortay:${varDir}:/tmp";
38 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/telio_tortay";
40 phpOptions = config.services.phpfpm.phpOptions + ''
41 disable_functions = "mail"
43 phpPackage = pkgs.php72;
45 services.websites.env.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ];
46 services.websites.env.production.vhostConfs.telio_tortay = {
47 certName = "telio_tortay";
48 certMainHost = "telio-tortay.immae.eu";
49 hosts = ["telio-tortay.immae.eu" "realistesmedia.fr" "www.realistesmedia.fr" ];
52 (adminer.apache.vhostConf null)
54 Use Stats telio-tortay.immae.eu
55 ServerAdmin ${env.server_admin}
56 ErrorLog "${varDir}/logs/error_log"
57 CustomLog "${varDir}/logs/access_log" combined
60 SetHandler "proxy:unix:${config.services.phpfpm.pools.telio_tortay.socket}|fcgi://localhost"
63 <Location /xmlrpc.php>
67 <Directory ${varDir}/logs>
72 DirectoryIndex index.php index.htm index.html
73 Options Indexes FollowSymLinks MultiViews Includes