Skip to content

Commit 6e39537

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1' into '5464-use-unique-id-for-additional-php-selection-in-website'
# Conflicts: # install/sql/incremental/upd_dev_collection.sql
2 parents fc98122 + a1e7fda commit 6e39537

File tree

7 files changed

+32
-7
lines changed

7 files changed

+32
-7
lines changed

install/sql/incremental/upd_dev_collection.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ UPDATE `web_domain` as w LEFT JOIN sys_group as g ON (g.groupid = w.sys_groupid)
5353

5454
-- we have to decide whether to delete the column or leave it there for investigating not-converted entries
5555
-- ALTER TABLE `web_domain` DROP COLUMN `fastcgi_php_version`;
56+
57+
ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumtext NULL DEFAULT NULL;
58+
ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL;

install/sql/ispconfig3.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,8 +2046,8 @@ CREATE TABLE `web_domain` (
20462046
`stats_password` varchar(255) default NULL,
20472047
`stats_type` varchar(255) default 'awstats',
20482048
`allow_override` varchar(255) NOT NULL default 'All',
2049-
`apache_directives` mediumtext,
2050-
`nginx_directives` mediumtext,
2049+
`apache_directives` mediumtext NULL DEFAULT NULL,
2050+
`nginx_directives` mediumtext NULL DEFAULT NULL,
20512051
`php_fpm_use_socket` ENUM('n','y') NOT NULL DEFAULT 'y',
20522052
`php_fpm_chroot` enum('n','y') NOT NULL DEFAULT 'n',
20532053
`pm` enum('static','dynamic','ondemand') NOT NULL DEFAULT 'ondemand',

install/tpl/nginx_apps.vhost.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ server {
200200
fastcgi_pass unix:{cgi_socket};
201201
}
202202

203-
location /images/mailman {
203+
location ^~ /images/mailman {
204204
alias /usr/share/images/mailman;
205205
}
206206

server/conf/nginx_apps.vhost.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ server {
191191
fastcgi_pass unix:{cgi_socket};
192192
}
193193

194-
location /images/mailman {
194+
location ^~ /images/mailman {
195195
alias /usr/share/images/mailman;
196196
}
197197

server/plugins-available/apache2_plugin.inc.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,13 @@ function update($event_name, $data) {
735735
// Check if the directories are there and create them if necessary.
736736
$app->system->web_folder_protection($data['new']['document_root'], false);
737737

738-
if(!is_dir($data['new']['document_root'].'/' . $web_folder)) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder);
738+
if(!is_dir($data['new']['document_root'].'/' . $web_folder)) {
739+
if($web_folder !== 'web') { //vhost sub/alias
740+
$app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder, 0755, $username, $groupname);
741+
} else {
742+
$app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder);
743+
}
744+
}
739745
if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/error') and $data['new']['errordocs']) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder . '/error');
740746
if($data['new']['stats_type'] != '' && !is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder . '/stats');
741747
if(!is_dir($data['new']['document_root'].'/ssl')) $app->system->mkdirpath($data['new']['document_root'].'/ssl');
@@ -1194,6 +1200,11 @@ function update($event_name, $data) {
11941200
$vhost_data['apache_directives'] = $snippet['snippet'];
11951201
}
11961202
}
1203+
1204+
if(!$vhost_data['apache_directives']) {
1205+
$vhost_data['apache_directives'] = ''; // ensure it is not null
1206+
}
1207+
11971208
// Make sure we only have Unix linebreaks
11981209
$vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']);
11991210
$vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']);

server/plugins-available/nginx_plugin.inc.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,13 @@ function update($event_name, $data) {
573573
// Check if the directories are there and create them if necessary.
574574
$app->system->web_folder_protection($data['new']['document_root'], false);
575575

576-
if(!is_dir($data['new']['document_root'].'/' . $web_folder)) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder);
576+
if(!is_dir($data['new']['document_root'].'/' . $web_folder)) {
577+
if($web_folder !== 'web') { //vhost sub/alias
578+
$app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder, 0755, $username, $groupname);
579+
} else {
580+
$app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder);
581+
}
582+
}
577583
if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/error') and $data['new']['errordocs']) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder . '/error');
578584
if($data['new']['stats_type'] != '' && !is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdirpath($data['new']['document_root'].'/' . $web_folder . '/stats');
579585
if(!is_dir($data['new']['document_root'].'/ssl')) $app->system->mkdirpath($data['new']['document_root'].'/ssl');
@@ -1193,6 +1199,9 @@ function update($event_name, $data) {
11931199
$nginx_directives = $data['new']['nginx_directives'];
11941200
// $vhost_data['enable_pagespeed'] = false;
11951201
}
1202+
if(!$nginx_directives) {
1203+
$nginx_directives = ''; // ensure it is not null
1204+
}
11961205

11971206
// folder_directive_snippets
11981207
if(trim($data['new']['folder_directive_snippets']) != ''){

server/plugins-available/nginx_reverseproxy_plugin.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ function update($event_name, $data) {
111111
$crt_file = $ssl_dir.'/'.$domain.'.crt';
112112
$bundle_file = $ssl_dir.'/'.$domain.'.bundle';
113113

114-
$vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']);
114+
if($vhost_data['nginx_directives']) {
115+
$vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']);
116+
}
115117

116118

117119
if($data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file)) {

0 commit comments

Comments
 (0)