Skip to content

Commit 659b5a4

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents c1bc454 + 2a91189 commit 659b5a4

File tree

4 files changed

+158
-97
lines changed

4 files changed

+158
-97
lines changed

server/conf/apache_ispconfig.conf.master

Lines changed: 64 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,129 +3,135 @@
33
# ISPConfig Logfile configuration for vlogger
44
################################################
55

6-
LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
7-
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
6+
SetEnvIf Request_URI "^/datalogstatus.php$" dontlog
87

9-
<IfModule mod_headers.c>
10-
<LocationMatch "/.well-known/acme-challenge/*">
11-
Header set Content-Type "text/plain"
12-
</LocationMatch>
13-
</IfModule>
8+
LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
9+
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog
1410

1511
<Directory /var/www/clients>
1612
AllowOverride None
17-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
18-
Require all denied
19-
<tmpl_else>
20-
Order Deny,Allow
21-
Deny from all
22-
</tmpl_if>
13+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
14+
Require all denied
15+
<tmpl_else>
16+
Order Deny,Allow
17+
Deny from all
18+
</tmpl_if>
2319
</Directory>
2420

2521
# Do not allow access to the root file system of the server for security reasons
2622
<Directory />
23+
Options -Indexes
2724
AllowOverride None
28-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
29-
Require all denied
30-
<tmpl_else>
31-
Order Deny,Allow
32-
Deny from all
33-
</tmpl_if>
25+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
26+
Require all denied
27+
<tmpl_else>
28+
Order Deny,Allow
29+
Deny from all
30+
</tmpl_if>
3431
</Directory>
3532

3633
<Directory /var/www/conf>
3734
AllowOverride None
38-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
39-
Require all denied
40-
<tmpl_else>
41-
Order Deny,Allow
42-
Deny from all
43-
</tmpl_if>
35+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
36+
Require all denied
37+
<tmpl_else>
38+
Order Deny,Allow
39+
Deny from all
40+
</tmpl_if>
4441
</Directory>
4542

4643
# Except of the following directories that contain website scripts
4744
<Directory /usr/share/phpmyadmin>
48-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
49-
Require all granted
50-
<tmpl_else>
45+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
46+
Require all granted
47+
<tmpl_else>
5148
Order allow,deny
5249
Allow from all
53-
</tmpl_if>
50+
</tmpl_if>
5451
</Directory>
5552

5653
<Directory /usr/share/phpMyAdmin>
57-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
58-
Require all granted
59-
<tmpl_else>
54+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
55+
Require all granted
56+
<tmpl_else>
6057
Order allow,deny
6158
Allow from all
62-
</tmpl_if>
59+
</tmpl_if>
6360
</Directory>
6461

6562
<Directory /srv/www/htdocs>
66-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
67-
Require all granted
68-
<tmpl_else>
63+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
64+
Require all granted
65+
<tmpl_else>
6966
Order allow,deny
7067
Allow from all
71-
</tmpl_if>
68+
</tmpl_if>
7269
</Directory>
7370

7471
<Directory /usr/share/squirrelmail>
75-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
76-
Require all granted
77-
<tmpl_else>
72+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
73+
Require all granted
74+
<tmpl_else>
7875
Order allow,deny
7976
Allow from all
80-
</tmpl_if>
77+
</tmpl_if>
8178
</Directory>
8279

8380
# Allow access to mailman on OpenSuSE
8481
<Directory /usr/lib/mailman/cgi-bin>
85-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
86-
Require all granted
87-
<tmpl_else>
82+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
83+
Require all granted
84+
<tmpl_else>
8885
Order allow,deny
8986
Allow from all
90-
</tmpl_if>
87+
</tmpl_if>
9188
</Directory>
9289

9390
<Directory /usr/lib/mailman/icons>
94-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
95-
Require all granted
96-
<tmpl_else>
91+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
92+
Require all granted
93+
<tmpl_else>
9794
Order allow,deny
9895
Allow from all
99-
</tmpl_if>
96+
</tmpl_if>
10097
</Directory>
10198

10299
<Directory /var/lib/mailman/archives/>
103100
Options +FollowSymLinks
104-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
105-
Require all granted
106-
<tmpl_else>
101+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
102+
Require all granted
103+
<tmpl_else>
107104
Order allow,deny
108105
Allow from all
109-
</tmpl_if>
106+
</tmpl_if>
110107
</Directory>
111108

112109
# allow path to awstats and alias for awstats icons
113110
<Directory /usr/share/awstats>
114-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
115-
Require all granted
116-
<tmpl_else>
111+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
112+
Require all granted
113+
<tmpl_else>
117114
Order allow,deny
118115
Allow from all
119-
</tmpl_if>
116+
</tmpl_if>
120117
</Directory>
121118

122119
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>
123120
Alias /awstats-icon "/usr/share/awstats/icon"
124121
</tmpl_if>
125122

123+
Alias /.well-known/acme-challenge /usr/local/ispconfig/interface/acme/.well-known/acme-challenge
124+
<Directory /usr/local/ispconfig/interface/acme/.well-known/acme-challenge>
125+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
126+
Require all granted
127+
<tmpl_else>
128+
Order allow,deny
129+
Allow from all
130+
</tmpl_if>
131+
</Directory>
132+
126133
NameVirtualHost *:80
127134
NameVirtualHost *:443
128135
<tmpl_loop name="ip_adresses">
129136
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
130137
</tmpl_loop>
131-

server/lib/classes/system.inc.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,17 +1840,17 @@ function umount_backup_dir($backup_dir, $mount_cmd = '/usr/local/ispconfig/serve
18401840
if ($this->is_mounted($backup_dir)){
18411841
exec($mount_cmd);
18421842
sleep(1);
1843-
}
1844-
}
18451843

1846-
$unmounted = $this->is_mounted($backup_dir) == 0 ? true : false;
1847-
if(!$unmounted) {
1848-
//* send email to admin that backup directory could not be unmounted
1849-
$global_config = $app->getconf->get_global_config('mail');
1850-
if($global_config['admin_mail'] != ''){
1851-
$subject = 'Backup directory '.$backup_dir.' could not be unmounted';
1852-
$message = "Backup directory ".$backup_dir." could not be unmounted.\n\nThe command\n\n".$mount_cmd."\n\nfailed.";
1853-
mail($global_config['admin_mail'], $subject, $message);
1844+
$unmounted = $this->is_mounted($backup_dir) == 0 ? true : false;
1845+
if(!$unmounted) {
1846+
//* send email to admin that backup directory could not be unmounted
1847+
$global_config = $app->getconf->get_global_config('mail');
1848+
if($global_config['admin_mail'] != ''){
1849+
$subject = 'Backup directory '.$backup_dir.' could not be unmounted';
1850+
$message = "Backup directory ".$backup_dir." could not be unmounted.\n\nThe command\n\n".$mount_cmd."\n\nfailed.";
1851+
mail($global_config['admin_mail'], $subject, $message);
1852+
}
1853+
}
18541854
}
18551855
}
18561856

server/scripts/ispconfig_update.sh

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
11
#!/bin/bash
22

3-
php -q \
4-
-d disable_classes= \
5-
-d disable_functions= \
6-
-d open_basedir= \
7-
/usr/local/ispconfig/server/scripts/ispconfig_update.php
3+
_UPD=1
4+
5+
##################################################
6+
##################################################
7+
##################################################
8+
##################################################
9+
##################################################
10+
##################################################
11+
12+
# padding handles script being overwritten during updates
13+
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
14+
15+
{
16+
if [ -n "${_UPD}" ]
17+
then
18+
n=$(readlink -f ${0})
19+
if [ "$(basename ${0})" == "ispconfig_update.sh" ]
20+
then
21+
cp -p ${n} ${n}.exec
22+
chmod +x ${n}.exec
23+
exec ${n}.exec
24+
else
25+
# clean up tmp .exec file
26+
if [ "$(basename ${0})" == "ispconfig_update.sh.exec" ]; then
27+
rm -f ${0}
28+
fi
29+
30+
exec php -q \
31+
-d disable_classes= \
32+
-d disable_functions= \
33+
-d open_basedir= \
34+
/usr/local/ispconfig/server/scripts/ispconfig_update.php
35+
36+
fi
37+
fi
38+
}
39+

server/scripts/update_stable.sh

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
11
#!/bin/bash
2-
{
3-
{
4-
umask 0077 \
5-
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
6-
&& test -d "${tmpdir}" \
7-
&& cd "${tmpdir}"
8-
} || {
9-
echo 'mktemp failed'
10-
exit 1
11-
}
122

13-
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
14-
if [ -f ISPConfig-3-stable.tar.gz ]
3+
_UPD=1
4+
5+
# padding handles script being overwritten during updates
6+
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
7+
8+
##################################################
9+
##################################################
10+
##################################################
11+
##################################################
12+
##################################################
13+
##################################################
14+
##################################################
15+
##################################################
16+
##################################################
17+
##################################################
18+
##################################################
19+
##################################################
20+
21+
{
22+
if [ -n "${_UPD}" ]
1523
then
16-
tar xvfz ISPConfig-3-stable.tar.gz
17-
cd ispconfig3_install/install/
18-
php -q \
19-
-d disable_classes= \
20-
-d disable_functions= \
21-
-d open_basedir= \
22-
update.php
23-
cd /tmp
24-
rm -rf "${tmpdir}"
25-
else
26-
echo "Unable to download the update."
27-
exit 1
24+
{
25+
umask 0077 \
26+
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
27+
&& test -d "${tmpdir}" \
28+
&& cd "${tmpdir}"
29+
} || {
30+
echo 'mktemp failed'
31+
exit 1
32+
}
33+
34+
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
35+
if [ -f ISPConfig-3-stable.tar.gz ]
36+
then
37+
tar xvfz ISPConfig-3-stable.tar.gz
38+
cd ispconfig3_install/install/
39+
php -q \
40+
-d disable_classes= \
41+
-d disable_functions= \
42+
-d open_basedir= \
43+
update.php
44+
cd /tmp
45+
rm -rf "${tmpdir}"
46+
else
47+
echo "Unable to download the update."
48+
exit 1
49+
fi
50+
2851
fi
2952

3053
exit 0

0 commit comments

Comments
 (0)