1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.papa.maison_bbc;
4 varDir = "/var/lib/ftp/papa/site";
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
8 options.myServices.websites.papa.maison_bbc.enable = lib.mkEnableOption "enable Papa Maison bbc website";
10 config = lib.mkIf cfg.enable {
11 services.duplyBackup.profiles.papa_maison_bbc.rootDir = varDir;
12 services.webstats.sites = [ { name = "maison.bbc.bouya.org"; } ];
13 services.phpfpm.pools.papa_maison_bbc = {
17 "listen.owner" = apacheUser;
18 "listen.group" = apacheGroup;
21 "pm.max_children" = "5";
22 "pm.process_idle_timeout" = "60";
24 "php_admin_value[open_basedir]" = varDir;
26 phpOptions = config.services.phpfpm.phpOptions + ''
27 date.timezone = 'Europe/Paris'
28 extension=${pkgs.php}/lib/php/extensions/mysqli.so
32 services.websites.env.production.modules = [ "proxy_fcgi" ];
33 services.websites.env.production.vhostNoSSLConfs.papa_maison_bbc = {
34 hosts = [ "maison.bbc.bouya.org" ];
38 Alias /.well-known/acme-challenge ${config.security.acme.certs.papa.webroot}/.well-known/acme-challenge
39 RedirectMatch 301 ^/((?!(\.well-known|add.php).*$).*)$ https://maison.bbc.bouya.org/$1
41 DirectoryIndex index.php index.htm index.html
45 SetHandler "proxy:unix:${config.services.phpfpm.pools.papa_maison_bbc.socket}|fcgi://localhost"
48 <Directory "${config.security.acme.certs.papa.webroot}">
49 Options Indexes FollowSymLinks
56 services.websites.env.production.vhostConfs.papa_maison_bbc = {
59 hosts = [ "maison.bbc.bouya.org" ];
65 DirectoryIndex index.php index.htm index.html
69 SetHandler "proxy:unix:${config.services.phpfpm.pools.papa_maison_bbc.socket}|fcgi://localhost"