diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql index 1c4bd539d9f40e84cb199b320a2cac3b1c5607e3..1aaf51cd2affca613f26d33ba4d70a24488b07da 100644 --- a/install/sql/incremental/upd_dev_collection.sql +++ b/install/sql/incremental/upd_dev_collection.sql @@ -44,3 +44,6 @@ ALTER TABLE `web_domain` DROP COLUMN `enable_spdy`; -- was missing in incremental, inserted for fixing older installations ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`; + +ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumtext NULL DEFAULT NULL; +ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL; \ No newline at end of file diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index cdf85d74434f9a7346cf1f23ae8ceecb46d7a13c..3f6f04ace7cd807be8b6dd4ae087470479ea802a 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -2046,8 +2046,8 @@ CREATE TABLE `web_domain` ( `stats_password` varchar(255) default NULL, `stats_type` varchar(255) default 'awstats', `allow_override` varchar(255) NOT NULL default 'All', - `apache_directives` mediumtext, - `nginx_directives` mediumtext, + `apache_directives` mediumtext NULL DEFAULT NULL, + `nginx_directives` mediumtext NULL DEFAULT NULL, `php_fpm_use_socket` ENUM('n','y') NOT NULL DEFAULT 'y', `php_fpm_chroot` enum('n','y') NOT NULL DEFAULT 'n', `pm` enum('static','dynamic','ondemand') NOT NULL DEFAULT 'ondemand', diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index cf58ed8a2013fd25d1dbefe0948d96eb55d5da3a..aab398637609cdee52265106a344439154fc63d6 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -1186,6 +1186,11 @@ class apache2_plugin { $vhost_data['apache_directives'] = $snippet['snippet']; } } + + if(!$vhost_data['apache_directives']) { + $vhost_data['apache_directives'] = ''; // ensure it is not null + } + // Make sure we only have Unix linebreaks $vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']); $vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']); diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index f7f93b4be51eb3d59d528af62681fac66a353b6f..dd9316c926000f24c630931dab1d8dcf204c192f 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1200,6 +1200,9 @@ class nginx_plugin { $nginx_directives = $data['new']['nginx_directives']; // $vhost_data['enable_pagespeed'] = false; } + if(!$nginx_directives) { + $nginx_directives = ''; // ensure it is not null + } // folder_directive_snippets if(trim($data['new']['folder_directive_snippets']) != ''){ diff --git a/server/plugins-available/nginx_reverseproxy_plugin.inc.php b/server/plugins-available/nginx_reverseproxy_plugin.inc.php index 1013042254ba2a2c63980394e6dc964021beb1f8..f35f40d34a2fd638de9532da7b7e30717c0c6e6b 100644 --- a/server/plugins-available/nginx_reverseproxy_plugin.inc.php +++ b/server/plugins-available/nginx_reverseproxy_plugin.inc.php @@ -111,7 +111,9 @@ class nginx_reverseproxy_plugin { $crt_file = $ssl_dir.'/'.$domain.'.crt'; $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; - $vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']); + if($vhost_data['nginx_directives']) { + $vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']); + } if($data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file)) {