Difference between revisions of "NextCloud"

From Jon's Wiki
Line 19: Line 19:
  
 
You will need {{code | AllowOverride All}} for the parent {{code | /var/www}} directory in {{code | /etc/apache2/apache.conf}} otherwise clean URLs won't work.
 
You will need {{code | AllowOverride All}} for the parent {{code | /var/www}} directory in {{code | /etc/apache2/apache.conf}} otherwise clean URLs won't work.
 +
 +
Add <tt>'overwriteprotocol' => 'https'</tt> to config.php to force all URLs to use SSL; this may trip up things like OAuth plugins.
  
 
Bump up the PHP memory limit to at least 512M.
 
Bump up the PHP memory limit to at least 512M.

Revision as of 04:05, 3 December 2020

Assumes Ubuntu 20.04, stable19 branch (c. September 2020).

Install prerequisites

sudo apt install apache2 libapache2-mod-php7.4 \
   php7.4-{bcmath,curl,gd,gmp,intl,json,mbstring,opcache,pgsql,tidy,xmlrpc,xsl,zip}
   php-{imagick,redis} composer dehydrated postgresql redis-server

cd /var/www
git clone https://github.com/nextcloud/server.git nextcloud && cd nextcloud
git submodule update --init --recursive
chown www-data:www-data config apps .htaccess
sudo -u www-data ./occ maintenance:update:htaccess
mkdir /var/lib/nextcloud/data
chown -R www-data:www-data /var/lib/nextcloud

a2enmod rewrite ssl headers dir env setenvif

You will need AllowOverride All for the parent /var/www directory in /etc/apache2/apache.conf otherwise clean URLs won't work.

Add 'overwriteprotocol' => 'https' to config.php to force all URLs to use SSL; this may trip up things like OAuth plugins.

Bump up the PHP memory limit to at least 512M.

Create a PostgreSQL database, navigate to the URL in the browser to install (or run the NextCloud ./occ tool from the command line).

Edit /etc/ImageMagick/policy.xml and remove this line to get PDF previews:'

<policy domain="coder" rights="none" pattern="PDF" /> 

Add stuff to enabledPreviewProviders in config.php

For now, Photos is pretty broken in stable19, so use Gallery which stopped at stable17, update its domPurify JS library, and bump the max version in appinfo/info.xml