Compare commits

..

4 Commits

+64 -42
View File
@@ -20,7 +20,11 @@ in
phpPackage = mcfg.php.env; phpPackage = mcfg.php.env;
phpOptions = mcfg.php.options; phpOptions = mcfg.php.options;
enablePerl = true; # NOTE: we include our own `mod_perl` in `extraModules` instead.
enablePerl = false;
# NOTE: we include `mod_userdir` in `extraModules` and configure this in `extraConfig` ourselves.
# enableUserDir = false;
# TODO: mod_log_journald in v2.5 # TODO: mod_log_journald in v2.5
extraModules = [ extraModules = [
@@ -45,22 +49,9 @@ in
logPerVirtualHost = false; logPerVirtualHost = false;
extraConfig = '' extraConfig = lib.mkIf mcfg.debugMode ''
TraceEnable on TraceEnable on
LogLevel warn rewrite:trace3 LogLevel warn rewrite:trace3
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
<FilesMatch "\.pl$">
SetHandler modperl
PerlResponseHandler ModPerl::Registry
Options +ExecCGI
</FilesMatch>
''; '';
virtualHosts."temmie.pvv.ntnu.no" = { virtualHosts."temmie.pvv.ntnu.no" = {
@@ -95,6 +86,9 @@ in
"index.php" "index.php"
"index.php3" "index.php3"
"index.php4" "index.php4"
"index.php5"
"index.php7"
"index.php8"
"index.pht" "index.pht"
"index.phtml" "index.phtml"
@@ -112,38 +106,66 @@ in
Require all granted Require all granted
</Directory> </Directory>
<DirectoryMatch "^/home/pvv/.*/web-docs/(${lib.concatStringsSep "|" [ ${lib.concatMapStringsSep "\n" (d: ''
"\\.git" <Directory "${d}">
"\\.hg" Require all denied
"\\.svn" </Directory>
"\\.ssh" '') [
"\\.env" ".git"
"\\.env\\..*" ".hg"
"\\.envs" ".svn"
"\\.envs\\..*" ".ssh"
"\\.envrc" ".bzr"
"\\.bzr" ".venv"
"\\.venv"
"CVS" "CVS"
"RCS" "RCS"
".*\\.swp" "*.bak"
".*~" "*.bak*"
"*.bkp"
"*.bkp*"
"*.backup"
"*.backup*"
]}
".*\\.bak" ${lib.concatMapStringsSep "\n" (d: ''
".*\\.bak.*" <Files "${d}">
".*\\.bkp"
".*\\.bkp.*"
".*\\.backup"
".*\\.backup.*"
".*\\.lck"
".*\\.lock"
"LCK\\.\\..*"
]})(/|$)">
AllowOverride All
Require all denied Require all denied
</DirectoryMatch> </Files>
'') [
".env"
".env.*"
".envs"
".envs.*"
".envrc"
"*.swp"
"*~"
"*.bak"
"*.bak*"
"*.bkp"
"*.bkp*"
"*.backup"
"*.backup*"
"*.lck"
"*.lock"
"LCK..*"
]}
<FilesMatch ".+\.ph(p[34578]?|t|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
<FilesMatch "\.pl$">
SetHandler modperl
PerlResponseHandler ModPerl::Registry
Options +ExecCGI
</FilesMatch>
''; '';
}; };
}; };