diff --git a/debian/postinst b/debian/postinst index d7dab6306..c5f578c46 100755 --- a/debian/postinst +++ b/debian/postinst @@ -111,6 +111,7 @@ dpkg-handling() { db_get "dokku/hostname" echo "Setting VHOST contents to $RET" echo "$RET" >"${DOKKU_ROOT}/VHOST" + chown dokku:dokku "${DOKKU_ROOT}/VHOST" fi fi diff --git a/plugins/domains/functions b/plugins/domains/functions index d32f6e108..79341b6a3 100755 --- a/plugins/domains/functions +++ b/plugins/domains/functions @@ -34,6 +34,7 @@ domains_setup() { if [[ -n "$DEFAULT_VHOSTS" ]]; then dokku_log_info1 "Creating new app virtual host file..." echo "$DEFAULT_VHOSTS" >"$APP_VHOST_PATH" + chown "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "$APP_VHOST_PATH" else dokku_log_info2 "Global server virtual host not set, disabling app vhost..." disable_app_vhost "$APP" --no-restart