diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php
index db515fc2..88116a22 100644
--- a/actions/admin/settings/130.webserver.php
+++ b/actions/admin/settings/130.webserver.php
@@ -33,6 +33,15 @@ return array(
'save_method' => 'storeSettingField',
'overview_option' => true
),
+ 'system_apache_24' => array(
+ 'label' => $lng['serversettings']['apache_24'],
+ 'settinggroup' => 'system',
+ 'varname' => 'apache24',
+ 'type' => 'bool',
+ 'default' => false,
+ 'save_method' => 'storeSettingField',
+ 'websrv_avail' => array('apache2')
+ ),
'system_httpuser' => array(
'label' => $lng['admin']['webserver_user'],
'settinggroup' => 'system',
diff --git a/install/froxlor.sql b/install/froxlor.sql
index 15a5da7f..d90270e9 100644
--- a/install/froxlor.sql
+++ b/install/froxlor.sql
@@ -1,4 +1,3 @@
-DROP TABLE IF EXISTS `ftp_groups`;
CREATE TABLE `ftp_groups` (
`id` int(20) NOT NULL auto_increment,
`groupname` varchar(60) NOT NULL default '',
@@ -509,6 +508,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('system', 'nginx_php_backend', '127.0.0.1:8888'),
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
('system', 'phpreload_command', ''),
+ ('system', 'apache24', '0'),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),
('panel', 'phpmyadmin_url', ''),
@@ -531,7 +531,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('panel', 'allow_preset', '1'),
('panel', 'allow_preset_admin', '0'),
('panel', 'password_regex', ''),
- ('panel', 'version', '0.9.28-svn5');
+ ('panel', 'version', '0.9.28-svn6');
diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php
index 83d33b99..858103de 100644
--- a/install/updates/froxlor/0.9/update_0.9.inc.php
+++ b/install/updates/froxlor/0.9/update_0.9.inc.php
@@ -1984,3 +1984,18 @@ if(isFroxlorVersion('0.9.28-svn4')) {
updateToVersion('0.9.28-svn5');
}
+
+if(isFroxlorVersion('0.9.28-svn5')) {
+ showUpdateStep("Updating from 0.9.28-svn5 to 0.9.28-svn6", true);
+ lastStepStatus(0);
+
+ $update_system_apache24 = isset($_POST['update_system_apache24']) ? (int)$_POST['update_system_apache24'] : '0';
+ showUpdateStep('Setting value for apache-2.4 modification', true);
+
+ // support for Apache-2.4
+ $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'apache24', '".$update_system_apache24."');");
+
+ lastStepStatus(0);
+
+ updateToVersion('0.9.28-svn6');
+}
diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php
index e6b90d38..73935efd 100644
--- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php
+++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php
@@ -451,4 +451,14 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
+
+ if (versionInUpdate($current_version, '0.9.28-svn6')) {
+ $has_preconfig = true;
+ $description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.
';
+ $description.= '
LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_host_module modules/mod_authz_host.so
';
+ $question = 'Do you want to enable the Apache-2.4 modification?: ';
+ $question.= makeyesno('update_system_apache24', '1', '0', '0');
+
+ eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
+ }
}
diff --git a/lng/english.lng.php b/lng/english.lng.php
index 08f766a1..75859e6b 100644
--- a/lng/english.lng.php
+++ b/lng/english.lng.php
@@ -1928,3 +1928,5 @@ $lng['error']['featureisdisabled'] = 'Feature %s is disabled. Please contact you
$lng['serversettings']['catchall_enabled']['title'] = 'Use Catchall';
$lng['serversettings']['catchall_enabled']['description'] = 'Do you want to provide your customers the catchall-feature?';
+// ADDED IN 0.9.28.svn6
+$lng['serversettings']['apache_24'] = 'Use modifications for Apache 2.4';
diff --git a/lng/german.lng.php b/lng/german.lng.php
index 661581f5..83f46b47 100644
--- a/lng/german.lng.php
+++ b/lng/german.lng.php
@@ -1653,3 +1653,5 @@ $lng['error']['featureisdisabled'] = 'Die Funktion %s wurde deaktiviert. Kontakt
$lng['serversettings']['catchall_enabled']['title'] = 'Catchall verwenden';
$lng['serversettings']['catchall_enabled']['description'] = 'Möchten Sie Ihren Kunden die Funktion Catchall zur Verfügung stellen?';
+// ADDED IN 0.9.28.svn6
+$lng['serversettings']['apache_24'] = 'Anpassungen für Apache 2.4 verwenden';
diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php
index fd23b474..ecc7f05d 100644
--- a/scripts/jobs/cron_tasks.inc.http.10.apache.php
+++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php
@@ -109,8 +109,13 @@ class apache
}
$this->virtualhosts_data[$vhosts_filename].= ' settings['system']['documentroot_prefix'] . '">' . "\n";
- $this->virtualhosts_data[$vhosts_filename].= ' Order allow,deny' . "\n";
- $this->virtualhosts_data[$vhosts_filename].= ' allow from all' . "\n";
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $this->virtualhosts_data[$vhosts_filename].= ' Require all granted' . "\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].= ' ' . "\n";
}
}
@@ -196,8 +201,13 @@ class apache
if($row_ipsandports['namevirtualhost_statement'] == '1')
{
- $this->virtualhosts_data[$vhosts_filename].= 'NameVirtualHost ' . $ipport . "\n";
- $this->logger->logAction(CRON_ACTION, LOG_DEBUG, $ipport . ' :: inserted namevirtualhost-statement');
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $this->logger->logAction(CRON_ACTION, LOG_NOTICE, $ipport . ' :: namevirtualhost-statement no longer needed for apache-2.4');
+ } else {
+ $this->virtualhosts_data[$vhosts_filename].= 'NameVirtualHost ' . $ipport . "\n";
+ $this->logger->logAction(CRON_ACTION, LOG_DEBUG, $ipport . ' :: inserted namevirtualhost-statement');
+ }
}
if($row_ipsandports['vhostcontainer'] == '1')
@@ -252,8 +262,13 @@ class apache
$this->virtualhosts_data[$vhosts_filename].= ' AddHandler fcgid-script .php' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' FCGIWrapper ' . $starter_filename . ' .php' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' Options +ExecCGI' . "\n";
- $this->virtualhosts_data[$vhosts_filename].= ' Order allow,deny' . "\n";
- $this->virtualhosts_data[$vhosts_filename].= ' allow from all' . "\n";
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $this->virtualhosts_data[$vhosts_filename].= ' Require all granted' . "\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].= ' ' . "\n";
}
}
@@ -281,8 +296,13 @@ class apache
$this->virtualhosts_data[$vhosts_filename].= ' AddHandler php5-fastcgi .php'. "\n";
$this->virtualhosts_data[$vhosts_filename].= ' Action php5-fastcgi /fastcgiphp' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' Options +ExecCGI' . "\n";
- $this->virtualhosts_data[$vhosts_filename].= ' Order allow,deny' . "\n";
- $this->virtualhosts_data[$vhosts_filename].= ' allow from all' . "\n";
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $this->virtualhosts_data[$vhosts_filename].= ' Require all granted' . "\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].= ' ' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . 'fpm.external' . "\n";
}
@@ -1023,8 +1043,13 @@ class apache
{
$this->diroptions_data[$diroptions_filename].= ' AllowOverride None' . "\n";
$this->diroptions_data[$diroptions_filename].= ' AddHandler cgi-script .cgi .pl' . "\n";
- $this->diroptions_data[$diroptions_filename].= ' Order allow,deny' . "\n";
- $this->diroptions_data[$diroptions_filename].= ' Allow from all' . "\n";
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $this->diroptions_data[$diroptions_filename].= ' Require all granted' . "\n";
+ } else {
+ $this->diroptions_data[$diroptions_filename].= ' Order allow,deny' . "\n";
+ $this->diroptions_data[$diroptions_filename].= ' Allow from all' . "\n";
+ }
fwrite($this->debugHandler, ' cron_tasks: Task3 - Enabling perl execution' . "\n");
// check for suexec-workaround, #319
diff --git a/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php b/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php
index 34acd403..b277ae40 100644
--- a/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php
+++ b/scripts/jobs/cron_tasks.inc.http.15.apache_fcgid.php
@@ -49,8 +49,13 @@ class apache_fcgid extends apache
$php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n";
$php_options_text.= ' Options +ExecCGI' . "\n";
$php_options_text.= ' ' . "\n";
- $php_options_text.= ' Order allow,deny' . "\n";
- $php_options_text.= ' allow from all' . "\n";
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $php_options_text.= ' Require all granted' . "\n";
+ } else {
+ $php_options_text.= ' Order allow,deny' . "\n";
+ $php_options_text.= ' allow from all' . "\n";
+ }
$php_options_text.= ' ' . "\n";
if ($domain['ssl'] == 1 && $ssl_vhost) {
$php_options_text.= ' Alias /fastcgiphp ' . makeCorrectDir($php->getInterface()->getAliasConfigDir()) . 'ssl-fpm.external' . "\n";
@@ -78,9 +83,14 @@ class apache_fcgid extends apache
$php_options_text.= ' FCGIWrapper ' . $php->getInterface()->getStarterFile() . ' .' . $file_extension . "\n";
}
$php_options_text.= ' Options +ExecCGI' . "\n";
- $php_options_text.= ' ' . "\n";
- $php_options_text.= ' Order allow,deny' . "\n";
- $php_options_text.= ' allow from all' . "\n";
+ $php_options_text.= ' ' . "\n";
+ // >=apache-2.4 enabled?
+ if ($this->settings['system']['apache24'] == '1') {
+ $php_options_text.= ' Require all granted' . "\n";
+ } else {
+ $php_options_text.= ' Order allow,deny' . "\n";
+ $php_options_text.= ' allow from all' . "\n";
+ }
$php_options_text.= ' ' . "\n";
}
}