Skip to content

Commit

Permalink
add default/global directory options in apache regardless of whether …
Browse files Browse the repository at this point in the history
…fcgid/fpm is being used or not; fixes #485

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
  • Loading branch information
d00p committed Nov 27, 2017
1 parent 45c0915 commit e725b48
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions scripts/jobs/cron_tasks.inc.http.10.apache.php
Expand Up @@ -78,35 +78,27 @@ private function _createStandardDirectoryEntry()
}
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_dirfix_nofcgid.conf');

if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
// if we use fcgid or php-fpm we don't need this file
if (file_exists($vhosts_filename)) {
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'apache::_createStandardDirectoryEntry: unlinking ' . basename($vhosts_filename));
unlink(makeCorrectFile($vhosts_filename));
}
} else {
if (! isset($this->virtualhosts_data[$vhosts_filename])) {
$this->virtualhosts_data[$vhosts_filename] = '';
}
if (! isset($this->virtualhosts_data[$vhosts_filename])) {
$this->virtualhosts_data[$vhosts_filename] = '';
}

$this->virtualhosts_data[$vhosts_filename] .= ' <Directory "' . makeCorrectDir(Settings::Get('system.documentroot_prefix')) . '">' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' <Directory "' . makeCorrectDir(Settings::Get('system.documentroot_prefix')) . '">' . "\n";

// check for custom values, see #1638
$custom_opts = Settings::Get('system.apacheglobaldiropt');
if (! empty($custom_opts)) {
$this->virtualhosts_data[$vhosts_filename] .= $custom_opts . "\n";
// check for custom values, see #1638
$custom_opts = Settings::Get('system.apacheglobaldiropt');
if (! empty($custom_opts)) {
$this->virtualhosts_data[$vhosts_filename] .= $custom_opts . "\n";
} else {
// >=apache-2.4 enabled?
if (Settings::Get('system.apache24') == '1') {
$this->virtualhosts_data[$vhosts_filename] .= ' Require all granted' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' AllowOverride All' . "\n";
} else {
// >=apache-2.4 enabled?
if (Settings::Get('system.apache24') == '1') {
$this->virtualhosts_data[$vhosts_filename] .= ' Require all granted' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' AllowOverride All' . "\n";
} else {
$this->virtualhosts_data[$vhosts_filename] .= ' Order allow,deny' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' allow from all' . "\n";
}
$this->virtualhosts_data[$vhosts_filename] .= ' Order allow,deny' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' allow from all' . "\n";
}
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";
}
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";

$ocsp_cache_filename = makeCorrectFile($vhosts_folder . '/03_froxlor_ocsp_cache.conf');
if (Settings::Get('system.use_ssl') == '1' && Settings::Get('system.apache24') == 1) {
Expand Down

0 comments on commit e725b48

Please sign in to comment.