1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.patrick_fodella.ecolyeu;
4 varDir = "/var/lib/ftp/patrick_fodella/ecolyeu_pessicart";
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
8 options.myServices.websites.patrick_fodella.ecolyeu.enable = lib.mkEnableOption "enable Patrick Fodella Ecolyeu's website";
10 config = lib.mkIf cfg.enable {
11 services.webstats.sites = [ { name = "ecolyeu-pessicart-nice.fr"; } ];
13 system.activationScripts.patrick_fodella_ecolyeu = {
16 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/patrick_fodella_ecolyeu
19 systemd.services.phpfpm-patrick_fodella_ecolyeu.after = lib.mkAfter [ "mysql.service" ];
20 systemd.services.phpfpm-patrick_fodella_ecolyeu.wants = [ "mysql.service" ];
21 services.phpfpm.pools.patrick_fodella_ecolyeu = {
25 "listen.owner" = apacheUser;
26 "listen.group" = apacheGroup;
29 "pm.max_children" = "20";
30 "pm.start_servers" = "2";
31 "pm.min_spare_servers" = "1";
32 "pm.max_spare_servers" = "3";
34 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/patrick_fodella_ecolyeu:${varDir}:/tmp";
35 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/patrick_fodella_ecolyeu";
37 phpOptions = config.services.phpfpm.phpOptions + ''
38 disable_functions = "mail"
40 phpPackage = pkgs.php72;
42 services.websites.env.production.modules = [ "proxy_fcgi" ];
43 services.websites.env.production.vhostConfs.patrick_fodella_ecolyeu = {
44 certName = "patrick_fodella";
45 certMainHost = "ecolyeu-pessicart-nice.fr";
46 hosts = ["ecolyeu-pessicart-nice.fr" "www.ecolyeu-pessicart-nice.fr" ];
50 Use Stats ecolyeu-pessicart-nice.fr
53 RewriteCond "%{HTTP_HOST}" "!^www\.ecolyeu-pessicart-nice\.fr$" [NC]
54 RewriteRule ^(.+)$ https://www.ecolyeu-pessicart-nice.fr$1 [R=302,L]
57 SetHandler "proxy:unix:${config.services.phpfpm.pools.patrick_fodella_ecolyeu.socket}|fcgi://localhost"
60 <Location /xmlrpc.php>
65 DirectoryIndex index.php index.htm index.html
66 Options Indexes FollowSymLinks MultiViews Includes