add support for the new apache-2.4

Signed-off-by: Michael Kaufmann (d00p) <mkaufmann@nutime.de>
This commit is contained in:
Michael Kaufmann (d00p)
2013-02-25 09:59:26 +01:00
parent 519db12a85
commit d7eef7a8b2
8 changed files with 90 additions and 17 deletions

View File

@@ -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',

View File

@@ -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');

View File

@@ -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');
}

View File

@@ -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.<br />';
$description.= '<pre>LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_host_module modules/mod_authz_host.so</pre><br />';
$question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong>&nbsp;';
$question.= makeyesno('update_system_apache24', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}

View File

@@ -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';

View File

@@ -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&uuml;r Apache 2.4 verwenden';

View File

@@ -109,8 +109,13 @@ class apache
}
$this->virtualhosts_data[$vhosts_filename].= ' <Directory "' . $this->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].= ' </Directory>' . "\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].= ' </Directory>' . "\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].= ' </Directory>' . "\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

View File

@@ -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.= ' </FilesMatch>' . "\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.= ' </Directory>' . "\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.= ' </FilesMatch>' . "\n";
$php_options_text.= ' Order allow,deny' . "\n";
$php_options_text.= ' allow from all' . "\n";
$php_options_text.= ' </FilesMatch>' . "\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.= ' </Directory>' . "\n";
}
}