outsource a few directory-functions in a class; make apache-2.4 not create 'require all granted' if there is an active directory-protection or option set for the customerroot-dir, possibly fixes #1455

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-12-01 08:07:28 +01:00
parent e24e8297f1
commit 3be43c4848
6 changed files with 144 additions and 59 deletions

View File

@@ -19,7 +19,10 @@
$configcommand = array();
if (isConfigDir(Settings::Get('system.apacheconf_vhost'))) {
$vhostDir = new frxDirectory(Settings::Get('system.apacheconf_vhost'));
$optsDir = new frxDirectory(Settings::Get('system.apacheconf_diroptions'));
if ($vhostDir->isConfigDir()) {
$configcommand['vhost'] = 'mkdir -p ' . Settings::Get('system.apacheconf_vhost');
$configcommand['include'] = 'echo -e "\\nInclude ' . makeCorrectDir(Settings::Get('system.apacheconf_vhost')) . '*.conf" >> ' . makeCorrectFile(makeCorrectDir('/etc/apache2/httpd.conf'));
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude_shell "cat ' . makeCorrectDir(Settings::Get('system.apacheconf_vhost')) . '*.conf"\' >> /etc/lighttpd/lighttpd.conf';
@@ -29,7 +32,7 @@ if (isConfigDir(Settings::Get('system.apacheconf_vhost'))) {
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude "' . Settings::Get('system.apacheconf_vhost') . '"\' >> /etc/lighttpd/lighttpd.conf';
}
if (isConfigDir(Settings::Get('system.apacheconf_diroptions'))) {
if ($optsDir->isConfigDir()) {
$configcommand['diroptions'] = 'mkdir -p ' . Settings::Get('system.apacheconf_diroptions');
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude_shell "cat ' . makeCorrectDir(Settings::Get('system.apacheconf_diroptions')) . '*.conf"\' >> /etc/lighttpd/lighttpd.conf';
} else {