diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-04-09 14:30:42 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-04-09 21:50:30 +0200 |
commit | a09b787a01cfbd00270321fdddcfb87574327e5b (patch) | |
tree | ee4524b854834f263f59c6140a125b07aa97768a | |
parent | f6d34587a2d5d217484d5d4d4d9b9ec5ac7df844 (diff) | |
download | nextcloud-server-a09b787a01cfbd00270321fdddcfb87574327e5b.tar.gz nextcloud-server-a09b787a01cfbd00270321fdddcfb87574327e5b.zip |
Install and configure Nextcloud server as www-data
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 <danxuliu@gmail.com>
-rwxr-xr-x | tests/acceptance/run-local.sh | 9 |
1 files changed, 8 insertions, 1 deletions
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 {} \; |