@@ -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 ' ]);
0 commit comments