diff --git a/utils.inc.php b/utils.inc.php index 12391ce..9c2e012 100644 --- a/utils.inc.php +++ b/utils.inc.php @@ -150,7 +150,7 @@ function createNginxConfig($domain, $user, $herseUser, $hersePass) throw new Exception('You need an username AND a password to add a herse.'); } else { // add password file to domain - exec('mkdir -p /home'.'/'.$user.'/'.$domain); + exec('sudo -u '.$user.' mkdir -p /home'.'/'.$user.'/'.$domain); file_put_contents( '/home'.'/'.$user.'/'.$domain.'/.htpasswd', $herseUser.':'.password_hash($hersePass, PASSWORD_BCRYPT)