Skip to content

Commit 621f270

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.0.5' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.0.5
2 parents fbc02f2 + 60b7000 commit 621f270

File tree

7 files changed

+100
-30
lines changed

7 files changed

+100
-30
lines changed

install/dist/lib/opensuse.lib.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@
2929
*/
3030

3131
class installer_dist extends installer_base {
32-
32+
33+
public function __construct() {
34+
//** check apache modules */
35+
$mods = getapachemodules();
36+
if(in_array('authz_compat', $mods, true)) {
37+
swriteln($inst->lng(' WARNING! You are using mod_authz_compat.'));
38+
swriteln($inst->lng(' Please make sure that your apache config uses the new auth syntax:'));
39+
swriteln($inst->lng(' <Directory />'));
40+
swriteln($inst->lng(' Options None'));
41+
swriteln($inst->lng(' AllowOverride None'));
42+
swriteln($inst->lng(' Require all denied'));
43+
swriteln($inst->lng(' </Directory>'."\n"));
44+
45+
swriteln($inst->lng(' If it uses the old syntax (deny from all) ISPConfig would fail to work.'));
46+
}
47+
}
48+
3349
public function configure_mailman($status = 'insert') {
3450
global $conf;
3551

install/install.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
//** Installer Interface
8888
//****************************************************************************************************
8989
$inst = new installer();
90+
9091
swriteln($inst->lng(' Following will be a few questions for primary configuration so be careful.'));
9192
swriteln($inst->lng(' Default values are in [brackets] and can be accepted with <ENTER>.'));
9293
swriteln($inst->lng(' Tap in "quit" (without the quotes) to stop the installer.'."\n\n"));

install/lib/install.lib.php

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ function get_system_timezone() {
812812
if(!$timezone && is_link('/etc/localtime')) {
813813
$timezone = readlink('/etc/localtime');
814814
$timezone = str_replace('/usr/share/zoneinfo/', '', $timezone);
815+
$timezone = str_replace('..', '', $timezone);
815816
if(substr($timezone, 0, 6) === 'posix/') $timezone = substr($timezone, 6);
816817
} elseif(!$timezone) {
817818
$hash = md5_file('/etc/localtime');
@@ -829,29 +830,55 @@ function get_system_timezone() {
829830
}
830831

831832
function getapacheversion($get_minor = false) {
832-
global $app;
833-
834-
$cmd = '';
835-
if(is_installed('apache2ctl')) $cmd = 'apache2ctl -v';
836-
elseif(is_installed('apachectl')) $cmd = 'apachectl -v';
837-
else {
838-
$app->log("Could not check apache version, apachectl not found.", LOGLEVEL_WARN);
839-
return '2.2';
840-
}
841-
842-
exec($cmd, $output, $return_var);
843-
if($return_var != 0 || !$output[0]) {
844-
$app->log("Could not check apache version, apachectl did not return any data.", LOGLEVEL_WARN);
845-
return '2.2';
846-
}
847-
848-
if(preg_match('/version:\s*Apache\/(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i', $output[0], $matches)) {
849-
return $matches[1] . (isset($matches[3]) ? '.' . $matches[3] : '') . (isset($matches[5]) && $get_minor == true ? '.' . $matches[5] : '');
850-
} else {
851-
$app->log("Could not check apache version, did not find version string in apachectl output.", LOGLEVEL_WARN);
852-
return '2.2';
853-
}
833+
global $app;
834+
835+
$cmd = '';
836+
if(is_installed('apache2ctl')) $cmd = 'apache2ctl -v';
837+
elseif(is_installed('apachectl')) $cmd = 'apachectl -v';
838+
else {
839+
$app->log("Could not check apache version, apachectl not found.", LOGLEVEL_WARN);
840+
return '2.2';
841+
}
842+
843+
exec($cmd, $output, $return_var);
844+
if($return_var != 0 || !$output[0]) {
845+
$app->log("Could not check apache version, apachectl did not return any data.", LOGLEVEL_WARN);
846+
return '2.2';
847+
}
848+
849+
if(preg_match('/version:\s*Apache\/(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i', $output[0], $matches)) {
850+
return $matches[1] . (isset($matches[3]) ? '.' . $matches[3] : '') . (isset($matches[5]) && $get_minor == true ? '.' . $matches[5] : '');
851+
} else {
852+
$app->log("Could not check apache version, did not find version string in apachectl output.", LOGLEVEL_WARN);
853+
return '2.2';
854854
}
855+
}
855856

857+
function getapachemodules() {
858+
global $app;
859+
860+
$cmd = '';
861+
if(is_installed('apache2ctl')) $cmd = 'apache2ctl -t -D DUMP_MODULES';
862+
elseif(is_installed('apachectl')) $cmd = 'apachectl -t -D DUMP_MODULES';
863+
else {
864+
$app->log("Could not check apache modules, apachectl not found.", LOGLEVEL_WARN);
865+
return array();
866+
}
867+
868+
exec($cmd, $output, $return_var);
869+
if($return_var != 0 || !$output[0]) {
870+
$app->log("Could not check apache modules, apachectl did not return any data.", LOGLEVEL_WARN);
871+
return array();
872+
}
873+
874+
$modules = array();
875+
for($i = 0; $i < count($output); $i++) {
876+
if(preg_match('/^\s*(\w+)\s+\((shared|static)\)\s*$/', $output[$i], $matches)) {
877+
$modules[] = $matches[1];
878+
}
879+
}
880+
881+
return $modules;
882+
}
856883

857884
?>

install/tpl/apache_ispconfig.conf.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
99
<Directory /var/www/clients>
1010
AllowOverride None
1111
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
12-
Require all deny
12+
Require all denied
1313
<tmpl_else>
1414
Order Deny,Allow
1515
Deny from all
@@ -20,7 +20,7 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
2020
<Directory />
2121
AllowOverride None
2222
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
23-
Require all deny
23+
Require all denied
2424
<tmpl_else>
2525
Order Deny,Allow
2626
Deny from all
@@ -30,7 +30,7 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
3030
<Directory /var/www/conf>
3131
AllowOverride None
3232
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
33-
Require all deny
33+
Require all denied
3434
<tmpl_else>
3535
Order Deny,Allow
3636
Deny from all

server/conf/apache_ispconfig.conf.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
99
<Directory /var/www/clients>
1010
AllowOverride None
1111
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
12-
Require all deny
12+
Require all denied
1313
<tmpl_else>
1414
Order Deny,Allow
1515
Deny from all
@@ -20,7 +20,7 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
2020
<Directory />
2121
AllowOverride None
2222
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
23-
Require all deny
23+
Require all denied
2424
<tmpl_else>
2525
Order Deny,Allow
2626
Deny from all
@@ -30,7 +30,7 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
3030
<Directory /var/www/conf>
3131
AllowOverride None
3232
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
33-
Require all deny
33+
Require all denied
3434
<tmpl_else>
3535
Order Deny,Allow
3636
Deny from all

server/conf/vhost.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Directory {tmpl_var name='web_basedir'}/{tmpl_var name='domain'}>
33
AllowOverride None
44
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
5-
Require all deny
5+
Require all denied
66
<tmpl_else>
77
Order Deny,Allow
88
Deny from all

server/lib/classes/system.inc.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,32 @@ function getapacheversion($get_minor = false) {
17591759
}
17601760
}
17611761

1762+
function getapachemodules() {
1763+
global $app;
1764+
1765+
$cmd = '';
1766+
if(is_installed('apache2ctl')) $cmd = 'apache2ctl -t -D DUMP_MODULES';
1767+
elseif(is_installed('apachectl')) $cmd = 'apachectl -t -D DUMP_MODULES';
1768+
else {
1769+
$app->log("Could not check apache modules, apachectl not found.", LOGLEVEL_WARN);
1770+
return array();
1771+
}
1772+
1773+
exec($cmd, $output, $return_var);
1774+
if($return_var != 0 || !$output[0]) {
1775+
$app->log("Could not check apache modules, apachectl did not return any data.", LOGLEVEL_WARN);
1776+
return array();
1777+
}
1778+
1779+
$modules = array();
1780+
for($i = 0; $i < count($output); $i++) {
1781+
if(preg_match('/^\s*(\w+)\s+\((shared|static)\)\s*$/', $output[$i], $matches)) {
1782+
$modules[] = $matches[1];
1783+
}
1784+
}
1785+
1786+
return $modules;
1787+
}
17621788
}
17631789

17641790
?>

0 commit comments

Comments
 (0)