config = lib.mkIf cfg.enable {
services.webstats.sites = [ { name = "iridologie.icommandeur.org"; } ];
+ system.activationScripts.iridologie = {
+ deps = [ "httpd" ];
+ text = ''
+ install -m 0755 -o wwwrun -g wwwrun -d /var/lib/php/sessions/iridologie
+ '';
+ };
+ services.phpfpm.pools.iridologie = {
+ listen = "/run/phpfpm/iridologie.sock";
+ extraConfig = ''
+ user = wwwrun
+ group = wwwrun
+ 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/iridologie:${varDir}:/tmp"
+ php_admin_value[session.save_path] = "/var/lib/php/sessions/iridologie"
+ '';
+ };
+ services.websites.env.production.modules = [ "proxy_fcgi" ];
services.websites.env.production.vhostConfs.iridologie = {
certName = "aten";
- hosts = [ "icommandeur.org" "www.icommandeur.org" "iridologie.icommandeur.org" ];
+ addToCerts = true;
+ hosts = [ "iridologie.icommandeur.org" "icommandeur.org" "www.icommandeur.org" ];
root = varDir;
extraConfig = [
''
RewriteCond "%{HTTP_HOST}" "!^iridologie\.icommandeur\.org$" [NC]
RewriteRule ^(.+)$ https://iridologie.icommandeur.org$1 [R=302,L]
+ <FilesMatch "\.php$">
+ SetHandler "proxy:unix:/run/phpfpm/iridologie.sock|fcgi://localhost"
+ </FilesMatch>
+
<Directory ${varDir}>
- DirectoryIndex index.html
- AllowOverride None
+ DirectoryIndex index.php index.htm index.html
+ AllowOverride All
Require all granted
</Directory>
''