diff --git a/src/Cli/Configure/Plugin/Function_domain_add.php b/src/Cli/Configure/Plugin/Function_domain_add.php index 77cde29ce..f49c00639 100644 --- a/src/Cli/Configure/Plugin/Function_domain_add.php +++ b/src/Cli/Configure/Plugin/Function_domain_add.php @@ -125,8 +125,6 @@ function function_domain_add(Parse $parse, Data $data, $domain=''){ try { File::write($url, Core::object($route->data(), Core::OBJECT_JSON)); File::chmod($url, 0666); - Core::execute('chown www-data:www-data -R ' . $host_dir_root); - Core::execute('chmod 777 -R ' . $host_dir_root); } catch (Exception | FileWriteException | ObjectException $exception){ return $exception->getMessage() . PHP_EOL; } @@ -243,8 +241,6 @@ function function_domain_add(Parse $parse, Data $data, $domain=''){ try { File::write($url, Core::object($route->data(), Core::OBJECT_JSON)); File::chmod($url, 0666); - Core::execute('chown www-data:www-data -R ' . $host_dir_root); - Core::execute('chmod 777 -R ' . $host_dir_root); } catch (Exception | FileWriteException | ObjectException $exception){ return $exception->getMessage() . "\n"; } diff --git a/src/Cli/Configure/Plugin/Function_host_create.php b/src/Cli/Configure/Plugin/Function_host_create.php index fdcd22466..13a58e6b1 100644 --- a/src/Cli/Configure/Plugin/Function_host_create.php +++ b/src/Cli/Configure/Plugin/Function_host_create.php @@ -36,6 +36,10 @@ function function_host_create(Parse $parse, Data $data, $host='', $public_html=' $output = []; Core::execute('a2enmod rewrite', $output); $output = []; + $host_dir_root = $object->config(Config::DATA_PROJECT_DIR_ROOT) . 'Host' . $object->config('ds'); + Core::execute('chown www-data:www-data -R ' . $host_dir_root); + Core::execute('chmod 777 -R ' . $host_dir_root); Core::execute('service apache2 restart', $output); + }