Guide for installation of Nextcloud. '''WORK IN PROGRESS''' == Create database == Postgresql should work, but Nextcloud recommends MySQL. See [[MemberManual/Databases#Create_a_Database]]. We'll assume you name the database `${USER}_cloud`. == Software installation == === Put files in place === Get the Nextcloud tarball from [[https://nextcloud.com/install/#instructions-server|Nextcloud]]. Pick a directory where you'll host Nextcloud, for example `$HOME/www/next.your.domain`. We'll call it `$NEXTDIR`. Also pick a directory for data, for example `$HOME/var/nextcloud`. We'll call it `$NEXTDATA`. Unpack the source. {{{ unzip nextcloud-15.0.0.zip }}} Move the resulting `nextcloud` directory to where you decided to have the document root. {{{ mv nextcloud $NEXTDIR }}} Create an empty data directory in the document root. This is necessary for the duration of the installation, we'll delete it later. {{{ cd $NEXTDIR mkdir data }}} Adjust directory permissions: {{{ fsr setacl . system:anyuser none fsr sa . $USER.daemon rlk fsr sa config $USER.daemon rlidwk fsr sa data $USER.daemon rlidwk fsr sa apps $USER.daemon rlidwk }}} Delete some lines in the file `core/Migrations/Version14000Date20180129121024.php`. This doesn't play well with the HCoop default of not granting DROP on tables. The easiest fix seems to be to manually drop these later. {{{ @@ -49,11 +49,6 @@ /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); - $schema->dropTable('admin_sections'); - $schema->dropTable('admin_settings'); - $schema->dropTable('personal_sections'); - $schema->dropTable('personal_settings'); - return $schema; } } }}} Create the data directory and give it correct permissions: {{{ mkdir $NEXTDATA cd $NEXTDATA fsr setacl . system:anyuser none fsr sa . $USER.daemon rlidwk }}} == Domtool == {{{ web "cloud" where PhpVersion = php72; DocumentRoot = home "$NEXTDIR"; with rewriteRule "/.well-known/carddav" "/remote.php/dav" [redirectWith temp]; rewriteRule "/.well-known/caldav" "/remote.php/dav" [redirectWith temp]; end; }}} '''TODO: Translate additional settings from `.htaccess` and `.user.ini`''' == Nextcloud installation wizard == Open up the web site, which should now show you the installation wizard. Fill it out like so: {{{ Data folder: $NEXTDATA Database: MySQL/MariaDB Username: whatever you like Password: likewise DB hostname: mysql }}} == Additional configuration == Add this line to `$NEXDIR/config/config.php`, to enable the APCu cache: {{{ 'memcache.local' => '\OC\Memcache\APCu', }}} == Login == You should now be able to log in and look around Nextcloud. You may want to have a look at `Settings → Overview` for any warnings. You will see a bunch of warnings like this: {{{ Some app directories are owned by a different user than the web server one. This may be the case if apps have been installed manually. Check the permissions of the following app directories: /afs/hcoop.net/user/… }}}} These can be ignored. == Cleanup == Since we use a new data directory we can delete the one in the document root: {{{ cd $NEXTDIR rm -r data }}} We should drop those deprecated tables from before (this wasn't actually working for me, will look into how to drop tables in MySQL later). {{{ mysql-fixperms mysql -h mysql -p ${USER}_cloud DROP TABLE admin_sections; DROP TABLE admin_settings); DROP TABLE personal_sections; DROP TABLE 'personal_settings; }}}