From a09b787a01cfbd00270321fdddcfb87574327e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 9 Apr 2018 14:30:42 +0200 Subject: [PATCH] Install and configure Nextcloud server as www-data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apache sub-processes are run as the www-data user, and they need to be able to write to the "apps", "config" and "data" directories, so they have to belong to that user, and therefore the Nextcloud server has to be installed and configured too as the www-data user. The PHP built-in web server will still be run as the root user, but in that case the owner of those directories makes no difference, so this is compatible with both cases. Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/run-local.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/run-local.sh b/tests/acceptance/run-local.sh index 91f1729bee8..dc17d7ba60f 100755 --- a/tests/acceptance/run-local.sh +++ b/tests/acceptance/run-local.sh @@ -192,7 +192,14 @@ if [ "$NEXTCLOUD_SERVER_DOMAIN" != "$DEFAULT_NEXTCLOUD_SERVER_DOMAIN" ]; then fi echo "Installing and configuring Nextcloud server" -$ACCEPTANCE_TESTS_DIR/installAndConfigureServer.sh $INSTALL_AND_CONFIGURE_SERVER_PARAMETERS +# The server is installed and configured using the www-data user as it is the +# user that Apache sub-processes will be run as; the PHP built-in web server is +# run as the root user, and in that case the permissions of apps, config and +# data dirs makes no difference, so this is valid for both cases. +mkdir data +chown -R www-data:www-data apps config data +NEXTCLOUD_DIR=`pwd` +su --shell /bin/bash --login www-data --command "cd $NEXTCLOUD_DIR && $ACCEPTANCE_TESTS_DIR/installAndConfigureServer.sh $INSTALL_AND_CONFIGURE_SERVER_PARAMETERS" echo "Saving the default state so acceptance tests can reset to it" find . -name ".gitignore" -exec rm --force {} \;