update httpd fragment to add in private public option

This commit is contained in:
Brian Read 2024-06-28 14:57:57 +01:00
parent c5a708a382
commit fcc2a6fce8

View File

@ -1,17 +1,40 @@
# Alias for mailstats
Alias "/mailstats/css" "/opt/mailstats/css"
Alias "/mailstats" "/opt/mailstats/html"
{
# mailstats
my $status = $mailstats{'Status'} || 'disabled';
<Directory "/opt/mailstats/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch .php$>
if ($status eq 'enabled')
{
$OUT .="#-------------------------------------------------\n";
$OUT .="# mailstats settings from smeserver-mailstats\n";
$OUT .="#-------------------------------------------------\n";
$OUT .="\n";
$OUT .= qq(
# Alias for mailstats
Alias "/mailstats/css" "/opt/mailstats/css"
Alias "/mailstats" "/opt/mailstats/html"
<Directory "/opt/mailstats/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
);
$OUT .= (($mailstats{access} || 'private' ) eq "public" ) ? " Require all granted": " Require ip $localAccess $externalSSLAccess";
$OUT .= qq(
<FilesMatch .php\$\>
SetHandler "proxy:unix:/var/run/php-fpm/php74.sock|fcgi://localhost"
</FilesMatch>
</Directory>
</Directory>
<Directory "/opt/mailstats/css">
AllowOverride None
Require all granted
</Directory>
);
}
else
{
$OUT .= "# mailstats is disabled";
}
}
<Directory "/opt/mailstats/css">
AllowOverride None
Require all granted
</Directory>