1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.patrick_fodella.altermondia;
4 varDir = "/var/lib/ftp/patrick_fodella/altermondia";
5 apacheUser = config.services.httpd.Prod.user;
6 apacheGroup = config.services.httpd.Prod.group;
8 options.myServices.websites.patrick_fodella.altermondia.enable = lib.mkEnableOption "enable Patrick Fodella Altermondia's website";
10 config = lib.mkIf cfg.enable {
11 services.webstats.sites = [ { name = "altermondia.org"; } ];
13 system.activationScripts.patrick_fodella_altermondia = {
16 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/patrick_fodella_altermondia
19 systemd.services.phpfpm-patrick_fodella_altermondia.after = lib.mkAfter [ "mysql.service" ];
20 systemd.services.phpfpm-patrick_fodella_altermondia.wants = [ "mysql.service" ];
21 services.phpfpm.pools.patrick_fodella_altermondia = {
25 "listen.owner" = apacheUser;
26 "listen.group" = apacheGroup;
29 "pm.max_children" = "5";
30 "pm.process_idle_timeout" = "60";
32 "php_admin_value[open_basedir]" = "/var/lib/php/sessions/patrick_fodella_altermondia:${varDir}:/tmp";
33 "php_admin_value[session.save_path]" = "/var/lib/php/sessions/patrick_fodella_altermondia";
35 phpOptions = config.services.phpfpm.phpOptions + ''
36 disable_functions = "mail"
38 phpPackage = pkgs.php72;
40 services.websites.env.production.modules = [ "proxy_fcgi" ];
41 services.websites.env.production.vhostConfs.patrick_fodella_altermondia = {
42 certName = "patrick_fodella";
44 hosts = ["altermondia.org" "www.altermondia.org" ];
48 Use Stats altermondia.org
51 RewriteCond "%{HTTP_HOST}" "!^altermondia\.org$" [NC]
52 RewriteRule ^(.+)$ https://altermondia.org$1 [R=302,L]
55 SetHandler "proxy:unix:${config.services.phpfpm.pools.patrick_fodella_altermondia.socket}|fcgi://localhost"
58 <Location /xmlrpc.php>
63 DirectoryIndex index.php index.htm index.html
64 Options Indexes FollowSymLinks MultiViews Includes