Sunday 27 January 2019

Nextcloud on OpenSuse 15.0 Part 2

Now we've got the latest Nextcloud (15.X) running more or less satisfactorily on OpenSuse 15.0, it's now time to do a bit more detailed configuration.

First of all we need to set up a cron job to do the regular housekeeping that nextcloud needs. Currently, it kicks off this activity whenever a page loads but as more content gets added this begins to become a bottleneck. So, in a terminal session do the following as root:
  1.  crontab -u wwwrun -e
  2. This brings up an editor (vim) for the cron jobs assigned to the user wwwrun (which is the account nextcloud runs under). The editor commands are somewhat cryptic...to go into insert mode, press i and the cursor will move to the top of the screen
  3. Enter (or cut and paste) the following: */5  *  *  *  * php -f /srv/www/htdocs/nextcloud/cron.php
  4. Do not press Enter! 
  5. Now you are done, press Escape to get out of editing mode and then :q to quit and save.
  6. This will have scheduled the Nextcloud housekeeping to run every 5 minutes
Now, we need to tell Nextcloud that what has been done.
  1. In a browser, log into Nextcloud as the admin and navigate to the Settings | Basic Settings screen
  2. In the top Background Jobs section, click on Cron (you have to enter the admin password again to confirm).
Now it makes sense to update the Nextcloud config to ready for external access.
  1. Navigate to /srv/www/htdocs/nextcloud/config/ and open config.php in kate (or your text editor of choice).
  2. In the trusted domains_array add some entries after 0 => 'localhost', so that the Nextcloud server will work when accessed via other URL's besides localhost. I would suggest the following (adapted to your setup)...
    1. 1 => 'the-ip-address-of-the-server',
    2. 2 => 'servername.domain.com',
    3. 3 => 'servername.localdomain',

No comments: