</Location>
''}
- <Directory ${if environment == "dev" then root else webRoot}>
+ <Directory ${root}>
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride All
Require all granted
services.myWebsites.production.vhostConfs.aten = {
certName = "aten";
hosts = [ "aten.pro" "www.aten.pro" ];
- root = aten_prod.webRoot;
+ root = aten_prod.apache.root;
extraConfig = [ aten_prod.apache.vhostConf ];
};
})
let
cfg = config.services.myWebsites.Capitaines;
env = myconfig.env.websites.capitaines;
+ webappName = "capitaines_mastodon";
+ root = "/run/current-system/webapps/${webappName}";
siteDir = ./mastodon_static;
in {
options.services.myWebsites.Capitaines = {
security.acme.certs."capitaines_mastodon" = config.services.myCertificates.certConfig // {
domain = "mastodon.capitaines.fr";
};
+ system.extraSystemBuilderCmds = ''
+ mkdir -p $out/webapps
+ ln -s ${siteDir} $out/webapps/${webappName}
+ '';
services.myWebsites.production.vhostConfs.capitaines = {
certName = "capitaines_mastodon";
hosts = [ "mastodon.capitaines.fr" ];
- root = siteDir;
+ root = root;
extraConfig = [
''
ErrorDocument 404 /index.html
- <Directory ${siteDir}>
+ <Directory ${root}>
DirectoryIndex index.html
Options Indexes FollowSymLinks MultiViews Includes
Require all granted
SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
</FilesMatch>
- <Directory ${if environment == "dev" then root else webRoot}>
+ <Directory ${root}>
DirectoryIndex index.php index.htm index.html
Options -Indexes +FollowSymLinks +MultiViews +Includes
- Include ${if environment == "dev" then root else webRoot}/htaccess.txt
+ Include ${root}/htaccess.txt
AllowOverride AuthConfig FileInfo Limit
Require all granted
</Directory>
- <DirectoryMatch "${if environment == "dev" then root else webRoot}/squelettes">
+ <DirectoryMatch "${root}/squelettes">
Require all denied
</DirectoryMatch>
services.myWebsites.production.vhostConfs.chloe = {
certName = "chloe";
hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
- root = chloe_prod.webRoot;
+ root = chloe_prod.apache.root;
extraConfig = [ chloe_prod.apache.vhostConf ];
};
})
php_admin_value[session.save_path] = "/var/lib/php/sessions/adminer"
'';
};
- apache = {
+ apache = rec {
user = "wwwrun";
group = "wwwrun";
modules = [ "proxy_fcgi" ];
+ webappName = "_adminer";
+ root = "/run/current-system/webapps/${webappName}";
vhostConf = ''
- Alias /adminer ${webRoot}
- <Directory ${webRoot}>
+ Alias /adminer ${root}
+ <Directory ${root}>
DirectoryIndex index.php
Require all granted
<FilesMatch "\.php$">
'' else ''
Use Stats connexionswing.com
- <Directory ${webRoot}>
+ <Directory ${root}>
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride All
Require all granted
services.myWebsites.production.vhostConfs.connexionswing = {
certName = "connexionswing";
hosts = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ];
- root = connexionswing_prod.webRoot;
+ root = connexionswing_prod.apache.root;
extraConfig = [ connexionswing_prod.apache.vhostConf ];
};
})
{ lib, pkgs, config, mylibs, myconfig, ... }:
let
cfg = config.services.myWebsites;
+ www_root = "/run/current-system/webapps/_www";
+ theme_root = "/run/current-system/webapps/_theme";
makeService = name: cfg: let
toVhost = vhostConf: {
enableSSL = true;
hostName = "nossl.immae.eu";
enableSSL = false;
logFormat = "combinedVhost";
- documentRoot = ../../www;
+ documentRoot = www_root;
extraConfig = ''
- <Directory ${../../www}>
+ <Directory ${www_root}>
DirectoryIndex nossl.html
AllowOverride None
Require all granted
fallbackVhost = toVhost { # Should go first, default choice
certName = "eldiron";
hosts = ["eldiron.immae.eu" ];
- root = ../../www;
+ root = www_root;
extraConfig = [ "DirectoryIndex index.htm" ];
};
in rec {
ErrorDocument 502 /maintenance_immae.html
ErrorDocument 503 /maintenance_immae.html
ErrorDocument 504 /maintenance_immae.html
- Alias /maintenance_immae.html ${../../www}/maintenance_immae.html
+ Alias /maintenance_immae.html ${www_root}/maintenance_immae.html
ProxyPass /maintenance_immae.html !
- AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${../../www}/googleb6d69446ff4ca3e5.html
- <Directory ${../../www}>
+ AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${www_root}/googleb6d69446ff4ca3e5.html
+ <Directory ${www_root}>
AllowOverride None
Require all granted
</Directory>
apaxy = {
extraConfig = ''
<Macro Apaxy %{folder} %{ignored}>
- Alias /theme ${./apache/theme}
- <Directory ${./apache/theme}>
+ Alias /theme ${theme_root}
+ <Directory ${theme_root}>
Options -Indexes
AllowOverride None
Require all granted
'';
};
+ system.extraSystemBuilderCmds = let
+ adminer = pkgs.callPackage ./commons/adminer.nix {};
+ in ''
+ mkdir -p $out/webapps
+ ln -s ${../../www} $out/webapps/_www
+ ln -s ${./apache/theme} $out/webapps/_theme
+ ln -s ${adminer.webRoot} $out/webapps/${adminer.apache.webappName}
+ '';
+
services.myPhpfpm = {
phpPackage = pkgs.php;
phpOptions = ''
env = myconfig.env.websites.emilia;
varDir = "/var/lib/moodle";
siteDir = ./moodle;
+ webappName = "emilia_moodle";
+ root = "/run/current-system/webapps/${webappName}";
# php_admin_value[upload_max_filesize] = 50000000
# php_admin_value[post_max_size] = 50000000
configFile = ''
system.activationScripts.emilia = ''
install -m 0755 -o wwwrun -g wwwrun -d ${varDir}
'';
+ system.extraSystemBuilderCmds = ''
+ mkdir -p $out/webapps
+ ln -s ${siteDir} $out/webapps/${webappName}
+ '';
services.myWebsites.production.vhostConfs.emilia = {
certName = "emilia";
hosts = [ "saison-photo.org" "www.saison-photo.org" ];
- root = siteDir;
+ root = root;
extraConfig = [
''
- <Directory ${siteDir}>
+ <Directory ${root}>
DirectoryIndex pause.html
Options Indexes FollowSymLinks MultiViews Includes
Require all granted
root = varDir;
extraConfig = [
''
- Use Apaxy "${varDir}" "title"
+ Use Apaxy "${varDir}" "title .duplicity-ignore"
<FilesMatch ".+">
Header set Content-Disposition attachment
</FilesMatch>
services.myWebsites.production.vhostConfs.ludivine = {
certName = "ludivinecassal";
hosts = ["ludivinecassal.com" "www.ludivinecassal.com" ];
- root = ludivinecassal_prod.webRoot;
+ root = ludivinecassal_prod.apache.root;
extraConfig = [ ludivinecassal_prod.apache.vhostConf ];
};
})
'' else ''
Use Stats ludivinecassal.com
- <Directory ${webRoot}>
+ <Directory ${root}>
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride All
Require all granted
services.myWebsites.production.vhostConfs.piedsjaloux = {
certName = "piedsjaloux";
hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ];
- root = piedsjaloux_prod.webRoot;
+ root = piedsjaloux_prod.apache.root;
extraConfig = [ piedsjaloux_prod.apache.vhostConf ];
};
})
'' else ''
Use Stats piedsjaloux.fr
- <Directory ${webRoot}>
+ <Directory ${root}>
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride All
Require all granted